Created
November 12, 2008 20:44
-
-
Save deadprogram/24262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Autotest::Growl | |
def self.growl title, msg, img, pri=0, stick="" | |
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{ msg.inspect} #{title} #{stick}" | |
end | |
Autotest.add_hook :ran_command do |autotest| | |
output = autotest.results.last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?/) | |
if output =~ /[1-9]\sfailures?/ | |
growl "Test Results", "#{output}", "~/Library/autotest/rails_fail.png", 2, "-s" | |
else | |
growl "Test Results", "#{output}", "~/Library/autotest/rails_ok.png" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment