It would be nice if there was a way to run specific tests only, akin to rspec -e.
I.e. something to the tune of (in the CLI): rspec -e "match me"
rspec -e "match me"
Which would pass -e to rspec and consequently only run tests that match the string "match me".
Even nicer if we could temporarily scope the automatic runs, i.e. with something like: rspec scope -e "match me"
rspec scope -e "match me"
All subsequent runs would then only perform the "match me"-tests, until a different scope is given or the scope is removed with rspec scope.
Currently I keep a second shell window open in addition to guard where I run individual tests as needed (because the full suite takes too long for quick iteration). It would be nice to have that functionality baked right into guard for convenience.
Hum, interesting idea, we could probably start thinking about "guard plugins' custom interactive commands" so that each guard plugin could define its own commands in the interactor (the commands would always start with the name of the guard plugin, e.g. rspec <command>)...
In that case we should create a new disussion in the Guard issue tracker.
What do you think @guard/core-team ? Do you think it might be useful or overkill?
Yeah that an interesting idea, this is definitely something that need to be added first on Guard side. Maybe we could add this with the new support of coolline (and maybe Ruby 1.9 syntax only).
👍 really want it!
Starting with Guard 1.5.0, this can be achieved by implementing a Pry command. Guard itself has a change command that can serve as a starting point or you can extend the change command itself to to the filtering of existing files and pass them as changed files.
@netzpirat can you show quick example?
All Guard interactor commands are Pry commands: https://github.com/guard/guard/tree/master/lib/guard/commands
This is a really cool idea! What I would like to be possible is to have two different commands to running your test suite:
That would be really really helpful.
@pjg That's almost exactly what I need - well actually I want to run all specs tagged focus: true. I read @netzpirat's comment above, but it's still not at all clear to me how or even whether this is achievable.
If it is achievable right now, please could this issue be reopened until it is documented how to do this? Until it's documented, I think it is currently too hard for most users to achieve. (And if it's not achievable right now, I'm not sure why this issue was closed.)
@aspiers I'm not sure exactly what you want... perhaps this will help you? http://wowkhmer.com/2011/04/09/run-only-focus-examples-in-rspec-like-cucumber/
@pjg I'm already aware of that technique. But I want to be able to do that from inside guard! Isn't that the whole point of this github issue? Thanks ...
@kossnocorp have you something to share that works with Pry?