0

I have a rails 3 project with both specs and tests. If I fire up autotest it runs my specs. How can I make it run my tests instead? autotest -h is no help here.

John Bachir
  • 22,495
  • 29
  • 154
  • 227

2 Answers2

1

Try this on the command line:

RSPEC=false autotest

I know that setting the RSPEC environment variable to "true" works when autotest doesn't know it's supposed to run them, so the reverse might be true as well. I think recent versions assume that when they see specs, you're not using Test::Unit anymore, so hopefully they've kept this override.

Jaime Bellmyer
  • 23,051
  • 7
  • 53
  • 50
  • Didn't work for me… I also just noticed that if I rename my spec directory, it still does not run my tests, so maybe there is something more fundamental going on here. I'll make a ticket. – John Bachir Dec 08 '10 at 03:04
  • Hmm, zentest doesn't seem to have a ticket system anywhere. – John Bachir Dec 08 '10 at 03:05
0

Do you have the file "autotest/discovery.rb" under the app root? If you have, comment all the code, if not, create the dir and an empty file with the name.

Then add the following code to the file:

Autotest.add_hook :initialize do |at|
  at.add_mapping(%r%^test/(functional|integration|performance|unit)/.*rb$%) do |filename, _|
    filename
  end
end

Now you can run with your tests instead of specs.

Kevin
  • 1,845
  • 13
  • 12
  • Doesn't work for me. Autotest whines about "no such file to load -- test_helper (LoadError)" – ybakos Apr 10 '11 at 23:03