2

I've run into a problem using autotest with a Rails project, that when a test fails (ie, I modified a test file and autotest automatically runs the test), autotest continously tries to run the test (failing each time of course since the file hasn't yet been modified), instead of waiting until the file is saved again. And with growl notification on, this can be extremely annoying while I'm trying to fix the code to get the test to pass. It doesn't happen all the time, but most of the time. Has anyone else run into this and know the solution? Thanks.

insane.dreamer
  • 2,052
  • 1
  • 17
  • 21
  • Are you sure there's nothing that's saving the files? My IDE is set to automatically save files when it loses desktop focus, which in turn triggers autotest to re-run tests. – dbrown0708 Apr 08 '09 at 01:30
  • I'm using Textmate and I don't think it saves any files in the background. But my app uses Ferret and so running the tests is probably saving index files. But why would autotest be detecting those? – insane.dreamer Apr 08 '09 at 14:16
  • Also my IDE saving files wouldn't explain why autotest loops indefinitely only when a test fails and not when they succeed. – insane.dreamer Apr 08 '09 at 17:51

1 Answers1

5

I found the solution. Probably has to do with OSX (running this on Leopard) changing the .DS_Store file in the folder or another temp file. Adding the following to my .autotest did the trick (this also prevents autotest looking at the index folder generated by Ferret).

Autotest.add_hook :initialize do |at|
  %w{.git vendor index .DS_Store ._}.each {|exception| at.add_exception(exception)}
end
insane.dreamer
  • 2,052
  • 1
  • 17
  • 21
  • Also worth noting that if you use aruba with cucumber for developing command line apps, them the 'tmp' dir created by aruba should also be added to this list. – Michael Barton Feb 09 '14 at 22:35