2

I have this in .autotest:

Autotest.add_hook :initialize do |autotest|
  autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do
    autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
  end  
end

when I run autotest it initially runs all unit and integration (\requests) tests. Then when I change a file it runs only its unit tests and not the integrations.

any idea?

Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158

1 Answers1

3

You need to install and require the fsevent gem.

So:

sudo gem install autotest-fsevent

Or just gem install depending if you are using RVM

Then in your .autotest put the following require:

require 'autotest/fsevent'

You should also insure that it isn't running the whole test suite by going into the window/tab that is running autotest and hit ctrl-c once. That will restart your autotest and run all the tests that autotest is covering. I have found that autotest runs the most recent spec first then all the tests.

Hope this helps!

Sean
  • 2,891
  • 3
  • 29
  • 39
  • Thanks but I use windows and fsevent is not available. Any other way w/o manually ctrl-c? – Yaron Naveh Aug 25 '11 at 11:41
  • Looks like there is a thread on this. Check out: http://stackoverflow.com/questions/2896062/is-there-an-implementation-of-something-like-autotest-fsevent-for-windows – Sean Aug 25 '11 at 21:24
  • I did some reading and it looks like you may want to use the guard and guard-rspec gems to give yourself the same functionality. – Sean Aug 25 '11 at 21:30