Getting autotest working with Rails 3

Here’s all the stuff I needed to get autotest (formerly known as autospec) working with Rails 3 and rspec 2. I’m assuming you are using bundler.

# Gemfile
source 'http://rubygems.org'

gem 'rails', '3.0.1'

group :development, :test do
  gem 'rspec'
  gem 'rspec-rails'

  group :autotest do 
    gem 'ZenTest'
    gem 'autotest'
    gem 'autotest-rails'
  end
end
# .rspec
--format nested
--color
# autotest/discover.rb
Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

Then you can run:

$ autotest

at the command-line to run your specs automatically in a continuous testing fashion.

Categories: development

« Could not find gem 'zentest (>= 0, runtime)' in any of the gem sources ! Fingerprint already exists. Please use one ssh key per Heroku account »

Comments