Rails 3, unit test, and autotest

This is just a reminder for myself, I finally can run autotest with this setup on my mac:

Gemfile content:

snip ...
group :development, :test do
  gem 'webrat'
  gem 'mocha'
  gem 'ZenTest'
  gem 'autotest-rails'
  gem 'autotest-growl'
  gem 'autotest-fsevent'
end

RAILS_ROOT/.autotest (create one if it doesn’t exist) content:

require "ZenTest"
require "autotest/rails"
require "autotest/growl"
require "autotest/fsevent"
Autotest.add_hook :initialize do |autotest|
  %w{.git .svn .hg .DS_Store ._* vendor tmp log doc config .rvmrc Gemfile .autotest README Rakefile}.each do |exception|
    autotest.add_exception(exception)
  end
end

then go to your RAILS_ROOT directory, run bundle exec autotest, and watch those nice green growl pops up :D

Advertisements

One thought on “Rails 3, unit test, and autotest

  1. And i’m stealing your reminder right now, thank you it work’s for me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s