Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (16 sloc) 0.596 kb
module Autotest::Growl
def self.growl title, msg, img, pri=0, sticky=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
end
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 output
if $~[2].to_i > 0
growl "FAIL", "#{output}", "~/.autotest_images/fail.png", 2
else
growl "Pass", "#{output}", "~/.autotest_images/pass.png"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.