No Clean Feed - Stop Internet Censorship in Australia

Ryan Booker.com

Developer, diver, musician

Autotest Your Rails Apps

 | 2009-06-23 11:09:17 UTC | Tagged with: xp, agile, ruby, rails

Do this:

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

Edit ~/.autotest (create it if it doesn't exist) and add the following:

require 'autotest/fsevent'
require 'autotest/growl'
require 'redgreen/autotest'

If you want autotest to skip certain paths, you can add something like the following to ~/.autotest as well (thanks to Bitcetera):

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

Then run autotest for your rails app

$ cd myrailsapp
$ autotest

UPDATE: I've noticed that autotest seems to require complete restarts for similar reasons to the rails server. If you don't restart it, it will report a slew of false errors.