Nick Rutherford

This is a really good way of doing CI testing, as when you break your spec tests you'll get notified about it by Growl, and whatever image you chose (be it Bob the builder, Mr T, or whoever scares you ;).

I stepped through this process recently and hit on some snags so thought I'd list a process here. I'm on Leopard 10.5.5 using the Apple Ruby install.

What you'll get

While developing a rails app you'll have a terminal open running script/autospec (make sure your pwd is the root of your project, not the script directory, or it won't work). This will run your tests when it starts, and then again each time it notices that you've made changes to files in the project.

Normally you'd have to look at the terminal output to see the results, which is fine if you are paying attention, but in that case you might as well be using rake to do them manually. With Growl integration you'll get a floating message in a screen corner (configurable) telling you whether the tests still passed, or failed. This is a good way to know you've broke something you didn't expect, and stop to fix it before forgetting what you did!

Growl in the terminal

This isn't a default with the install, and I'd missed it.

Get the dmg from the growl website and go into the Extras/growlnotify dir while it is mounted.

You want to run the install.sh script, as the install.txt instructions are incorrect, or at least don't work for me (they look like instructions for a linux build, while we've been given a prebuilt binary).

To test it's working use growlnotify in the terminal, it works like cat so you'll need to end your input with ctrl d (the end-of-input keycode).

$ growlnotify tes

t
ing

gave me

growl terminal example

ZenTest

This is case sensitive.

sudo gem install ZenTest

redgreen

You need this gem too

sudo gem install redgreen

~/.autotest

Grab Ian's tgz and follow these steps:

  1. extract it by double clicking the tar file left wherever you downloaded it to
  2. move the directory to wherever you want to keep it (this will be where the images are stored so it makes sense to keep it out of your ~). e.g. ~/dev/bob-the-tester
  3. create a symlink of ~/.autotest -> growl.rb using
cd ~/dev/bob-the-tester
ln -s $(pwd)/growl.rb ~/.autotest

References

Ian's post on the Growl 1.1.2 network workaround is where I got my files and references from. I haven't switched over to using the network wrapped growl as according to this growl forum thread the disappearing notification issues have been fixed.

If you prefer the networked way of doing things then see Ian's article.

After some failures & testing with the command line tool I wasn't satisfied that 1.1.4 has actually resolved this issue so I've now switched to Ian's networked method.

Sorry, comments are closed for this article.