Over a million developers have joined DZone.

Continuous Testing For Ruby On Rails With Autotest And Rspec On Windows

Install Growl: 

Install following gems if you don't have them:

gem install autotest -v 4.2.10
gem install autotest-growl -v 0.2.4
gem install autotest-rails -v 4.1.0

gem install rspec -v 1.3.0
gem install rspec-rails -v 1.3.2
gem install test-unit -v 1.2.3
gem install win32console -v 1.3.0

Create file ~/.autotest

require 'autotest/growl' # enable pop-up windows
require 'autotest/restart' # optional: forces autotest to pick the changes to this file
require 'autotest/timestamp' # optional: shows timestamps for test runs

# filter out VCS files and other garbage to reduce HDD usage
Autotest.add_hook :initialize do |autotest|
  %w{.git .svn .hg .DS_Store ._* vendor tmp log doc}.each do |exception|

# do not clear console before running tests
Autotest::Growl::clear_terminal = false

Start Crowl (it also has option to automatically start at login).

Start autotest:


Or for rspec integration:


Just reminder how to run your specs manually in rails folder:

spec spec

Things that I failed to use successfully:
redgreen gem (uses PLATFORM contant from unknown source)
snarl + ruby-snarl gem + test_notifier gem (it just does not shows pop-up windows)
fsevent gem (MAC only)

More reading:



{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}