How to stop autotest/autospec from testing the entire project on a red to green transition

When developing a new module using TDD, I like to first write a failing test, then write the code to make the test pass, then repeat ad-nauseum.  If you are using autospec/autotest – which I love in general – it has this annoying habit of running the entire suite of tests on any red to green transition. This is quite inconvenient when you are rapidly iterating between red and green and your entire suite of tests takes a while to run.

So what I do is disable this behavior. It will only run the entire suite of tests in response to a Ctrl-C. Otherwise it will just test things that have changed. To do this comment out the following line (or do something that has that effect – personally I put an unless ENV['AUTOTEST_DONT_RUN_ENTIRE_SUITE_ON_RED_TO_GREEN_TRANSITION'] on the end of it): In /Library/Ruby/Gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb

411
412
# Comment out this line to disable a full test-suite run on every red->green transition.
# self.tainted = true unless self.files_to_test.empty?

You must be logged in to post a comment.