[rspec-users] Playing Sounds with Autotest/RSpec on Cygwin
andy at r210.com
Tue Feb 19 12:22:45 EST 2008
I've read about integrating Growl with Autotest/RSpec to display test results.
For cygwin users - here is a snippet that will play a sound after autotest runs.
Add the code below to your ~/.autotest file.
Modify the path of the .wav file to the sounds you want to play on your system.
Autotest.add_hook :ran_command do |at|
results = [at.results].flatten.join("\n")
output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+not implemented)?/)
if $~.to_i > 0
`cat /cygdrive/c/i386/ringout.wav > /dev/dsp` # failure
`cat /cygdrive/c/i386/chimes.wav > /dev/dsp` # success
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users