Here’s how to set it up – I’m assuming that you’ve already got a Rails application with the RSpec plugins installed:

  1. 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.

  2. Install ZenTest (version 3.6.1): gem install --include-dependencies ZenTest

  3. Install diff-lcs (version 1.1.2): gem install diff-lcs

    Update: see the comments for additional information about this gem.

  4. Install ruby-snarl (version 0.0.8): gem install ruby-snarl

  5. 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

  6. Download the install the GNU DiffUtils package – I installed this into my C:\Windows\System32 directory.

  7. 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:

    • accept.png
    • exclamation.png
    • information.png

    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.

  8. Create a file called .autotest in your Rails application root containing:

    require 'autotest/snarl'
  9. Open the spec/spec.opts file in your Rails application and remove the --color option (if it is present). My file looks like this:

  10. A screenshot of Snarl in action

    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!