Same question as waloeiii in twitter:
How can I have autospec/test not run the full test suite after everything goes green? The next test I write will be red!
I'd rather run the full test suite manually.
By the way, I tried adding a failing spec:
it "should flunk" do
flunk
end
but autospec seems to ignore it when it feels like it.
Bit late but I was looking for this as well so thought I'd post my solution:
Add the following to ~/.autotest:
class Autotest
def rerun_all_tests
end
end
Are you sure you are not confused about the intended behaviour of autotest's heuristics?
My understanding is that it runs tests for what has changed and will keep running failed tests until they pass and then once they pass it runs the whole test suite to make sure nothing else broke.
In effect it is being conservative and making sure you haven't introduced side effects that break other unrelated tests which is probably a good thing. The problem of course is that if you are doing fast red - green cycles you are going to be running your full suite a lot.
If you want to change these behaviours you need to edit the heuristics in the rails_autotest.rb
file for zentest.
You can use the following option to avoid this behavior -
autospec --no-full-after-failed
I think that this is by design - if you fix a failing spec, and all other specs in the section are green, then autospec will rerun the entire suite - this will tell you if the fix you applied to one area of your project has b0rked another or not.
If you just want to run the specs you are working on at any one time, then you can do it from the command line:
ruby spec/controllers/my_spec.rb
or from within Textmate by pressing cmd+r from your spec file. You should rerun your entire suite as you go anyway, otherwise you might be missing failing specs.
来源:https://stackoverflow.com/questions/1047118/how-can-i-have-autospec-test-not-run-the-full-test-suite-after-everything-goes-g