0

I changed my .autotest file to use it with a Ruby-based project.

After that, when I wanted to use it for Rails, it is using the .autotest configuration settings I used for the Ruby project.

I uninstalled autotest and reinstalled it with no luck. I also removed the .autotest file in the root directory but it is not working.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Subba Rao
  • 10,576
  • 7
  • 29
  • 31

3 Answers3

7

I'm trying to get autotest up and running as well. I just installed the gem. Running autotest or autotest --rails inside my rails app starts autotest, but it doesn't runs a single test. It reports that there aren't any.


UPDATE:

Just discovered I needed to install autotest-rails as well.

You should also install autotest-fsevent to make sure that autotest isn't polling all the time.

I've posted the results of my day of autotest at http://ryanbooker.com/archive/autotest-your-rails-apps.

The Short story:

sudo gem install ZenTest autotest-rails autotest-fsevent autotest-growl redgreen

Edit your ~/.autotest

# Include plugins
require 'autotest/fsevent'
require 'autotest/growl'
require 'redgreen/autotest' # yes this is correct

# Skip some paths
Autotest.add_hook :initialize do |autotest|
  %w{.git .DS_Store ._* vendor}.each { |exception| autotest.add_exception(exception) }
  false
end

You can launch autotest with:

cd myrailsapp
autotest
Ryan Booker
  • 433
  • 3
  • 9
  • FWIW: I was getting some issues when including 'autotest-rails' in my develompent.rb file. I switched to just config.gem 'autotest' and it all seemed to work properly. – Joshua Pinter Sep 19 '11 at 20:27
0

how are you launching autotest? If you use autotest --rails it should definitely work.

Ben Hughes
  • 14,075
  • 1
  • 41
  • 34
  • /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/shoulda_macros/searchable.rb test/functional/test_controller_test.rb test/test_helper.rb].each { |f| require f }" | unit_diff -u nope, above is the initial trace of autotest --rails – Subba Rao Jun 22 '09 at 19:14
0

If you are using Rails 3.1 or higher, I highly recommend using guard for TDD with rspec. It works like magic. https://github.com/guard/guard

JP.
  • 1,035
  • 2
  • 17
  • 39