Sunday, September 4, 2011

rails spork autotest failures repeating endlessly

Rails 3.1
Spork 0.9 rc9
ZenTest (installs autotest binary)
Fedora Linux

After launching spork, and then autotest, any failed tests will continuously get retested by autotest. This is because autotest is looking for changes in file dates and will rerun all tests if it finds a change.


.autotest setup can be found in

Edit ~/.autotest

  Autotest.add_hook :initialize do |autotest|
    autotest.add_exception %r{^\.git}  # ignore Version Control System
    autotest.add_exception %r{^./tmp}  # ignore temp files
    autotest.add_exception %r{^./log}  # ignore log

    # from rails tutorial 201109
    autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do

I had to add the log exception to stop the failure cycle.

No comments: