Use all_after_pass: true only for certain specs? #239

Closed
jmuheim opened this Issue Jan 1, 2014 · 6 comments

Projects

None yet

5 participants

@jmuheim

I find all_after_pass: true a very useful option, but in a large project it simply takes too much time (for example when having acceptance/request specs).

It would be nice to have an option to limit this option somehow, e.g. that only the tests in the specific file that was saved are rerun, or only the tests in the same folder (and maybe even subfolders).

@thibaudgg
Guard member

Sounds like a good idea, something like all_after_pass: ['features', 'models'] ?

Pull request is welcome, thanks!

@jmuheim

I will take a look at it if I find the time. What API would you suggest to rerun all tests in the same file?

@thibaudgg
Guard member

Maybe something like the new failed_mode option.

after_pass_mode with options like :all, :file (run all specs from the file(s)), :dir (run all specs from the same dir(s)), :none.

@toxaq

This would be awesome.

@907th
Guard member

We may also use a specific tag to mark specs we need to run after all. E.g.

after_pass_mode: :tag, after_pass_tag: :critical
@e2
e2 commented Jun 26, 2015

I'm closing this, because I think the whole "all_after_pass" can be replaced with 2 (or more) :rspec guards running RSpec with different tags, and the :halt_on_failure group option, e.g. like here:

http://stackoverflow.com/questions/21073910/how-to-get-guard-to-only-run-slow-specs-if-fast-specs-pass/27525210#27525210

Instead of supporting actions after successes, Guard::RSpec should rather focus on responding to failures (which is something Guard can't handle).

@e2 e2 closed this Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment