0

I know there are a few questions already regarding autotest and zentest but my problem seems a little different. In my case, if I run with

autotest

nothing happens other than a status message saying "Waiting since..." with no tests being run. If I run it with

autotest -s rspec2

Then all my tests run. If I change a spec file autotest knows and re-runs my tests. But if I change a controller file then I just get my "Waiting since..." message updated but no tests are run.

Any ideas what's going on? Or can someone please point me where I can look into this further?

.autotest (i actually don't know if # is how to comment out a section!)

require 'autotest/fsevent'
#require 'autotest/restart'
require 'autotest/growl'
require 'autotest/timestamp'

I never use "sudo gem install" because I am using rvm. So only "gem install X"

Lan
  • 6,039
  • 7
  • 22
  • 24

2 Answers2

1

Your problem looks very much similar to this autotest on ubuntu does nothing

Community
  • 1
  • 1
Raghu
  • 2,543
  • 1
  • 19
  • 24
0

The only gem you need is autotest, so deinstall the rest. Optionally, you can use autotest-fsevent and autotest-growl on a mac.

Make sure there is an autotest/discover.rb with the following contents:

Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

It should've been generated by rails generate rspec:install

If you have additional directories in your app directory, you add them to autotest by making a .autotest file, containing something like:

Autotest.add_hook :initialize do |at|
  at.add_mapping(%r%^spec/(.*)_spec\.rb$%) { |filename, _| filename }
  at.add_mapping(%r%^app/(.*)\.rb$%) { |_, m| ["spec/#{m[1]}_spec.rb"] }
end

(Answer based on Rails3 and RSpec2)

iain
  • 16,204
  • 4
  • 37
  • 41
  • well, when i "gem install autotest" it installs zentest. and when i try running "autotest" at the command line it tells me i probably need autotest-rails. so at that point i have autotest, zentest, and autotest-rails gems installed. – Lan Dec 10 '10 at 10:11