1
2 require 'autotest/redgreen'
3 require 'autotest/timestamp'
4
5
6
7
8
9
10
11
12
13 def growl(title, msg, pri=0, stick="", image="")
14 image_arg = (!image.empty?) ? "--image #{image}" : ""
15 system "growlnotify -n autotest #{image_arg} -p #{pri} -m #{msg.inspect} #{title} #{stick}"
16 end
17
18 Autotest.add_hook :red do |at|
19 growl("Tests Failed", "#{at.files_to_test.size} tests failed", 2, "", "/Applications/Mail.app/Contents/Resources/Caution.tiff")
20 end
21
22 Autotest.add_hook :green do |at|
23 growl("Tests Passed", "All tests passed", -2, "", "/Applications/Mail.app/Contents/Resources/certificate.tiff")
24 end