Here’s how to set it up – I’m assuming that you’ve already got a Rails application with the RSpec plugins installed:
Download and install Snarl (version 1.6). You’ll also be asked to install Melon, a Windows development toolkit, but you only need to install the core component when prompted.
Install ZenTest (version 3.6.1): gem install --include-dependencies ZenTest
Install diff-lcs (version 1.1.2): gem install diff-lcs
Install ruby-snarl (version 0.0.8): gem install ruby-snarl
Set the HOME user environment variable to your user profile directory, for example on my system it is set to: C:\Documents and Settings\Rob
Download the install the GNU DiffUtils package – I installed this into my C:\Windows\System32 directory.
Download and unzip the famfamfam Silk icons and copy the following files into $RUBY_HOME\lib\ruby\gems\1.8\gems\ZenTest-3.6.1\lib\icons where $RUBY_HOME is the directory where Ruby is installed:
You can of course use any icons you prefer: I’m currently using Crystal icons from Everaldo Coelho. Just make sure you use PNGs and, if necessary, rename them to accept.png, exclamation.png and information.png.
Create a file called .autotest in your Rails application root containing:
Open the spec/spec.opts file in your Rails application and remove the
--coloroption (if it is present). My file looks like this:
--format progress --loadby mtime --reverse
From your Rails application root type autotest to start the testing process and you should see Snarl notifications popping up as shown in the screenshot on the right.
Autotest will re-run your specifications each time you change your code and a Snarl notification will popup to tell you if you broke anything.
And finally: if you’re looking for a way to annoy your co-workers then you should take a look at Foz’s sound effects plugin for autotest and maybe use a DHH-style whoops when your specifications fail!