December 2008 Archives

Posted by Will about about 1 year ago

Displaying your RSpec results in Mumbles

I have been very happy with my recent work using RSpec and AutoTest (ZenTest) for a project at work. If you ever have to refactor a major piece of functionality, like the authentication, and then being able to ensure the behavior of the app is the same is very nice. The only thing that isn’t very nice is having to switch to a console or browser window to see if everything passed or not.

Then yesterday I ran across Get your Rails tests results via Growl notifications and I thought it should be fairly simple to use Mumbles instead. If you haven’t seen Growl it is a sexy looking popup notification app for Macs, Mumbles is a very simple replacement that runs under Linux. It supports sending and receiving network message can talk to a Growl network.

So after jumping through a couple of hoops to get Mumbles working under Gentoo, here is what I did to get sexy popup notifications:

Create a ~/.autotest file with the following

UPDATE: I made a couple of changes to the autotest file, there was still some old cruft from the Growl autotest config that I never dealt with.

 1 module Autotest::Mumbles
 2   def self.mumble title, msg
 3     system 'mumbles-send', title, msg
 4   end
 5 
 6   Autotest.add_hook :ran_command do |at|
 7     mumble "Test Results", at.results.last
 8   end
 9 end

Now restart your autotest and watch for the popups! I said it was simple right? Now I don’t have to switch to another terminal and look to see if everything passed.

Posted by Will on Dec 15, 2008