Skip to content
Newer
Older
100644 19 lines (17 sloc) 608 Bytes
ce4bca4 @bjeanes added some autotest stuff
bjeanes authored Aug 14, 2008
1 require 'autotest/redgreen'
2 require 'autotest/timestamp'
3
4 module Autotest::Growl
5 def self.growl title, msg, img, pri=0, sticky=""
957d5a9 @bjeanes Fixed my autotest file (was using icon of image instead of actual ima…
bjeanes authored Dec 17, 2008
6 system "growlnotify -n autotest -d #{title} --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
ce4bca4 @bjeanes added some autotest stuff
bjeanes authored Aug 14, 2008
7 end
8
9 Autotest.add_hook :ran_command do |at|
10 unless at.results.empty?
641dbe4 @bjeanes Some more aliases and a fix for autospec
bjeanes authored Feb 4, 2009
11 output = at.results.last.slice(/(\d+)\s.*(?:examples|assertions)?,\s(\d+)\s.*failures?/)
ce4bca4 @bjeanes added some autotest stuff
bjeanes authored Aug 14, 2008
12 if output =~ /[1-9]\sfailures?/
13 growl "Tests", "#{output}", "~/.ruby_fail.png", 2, "-s"
14 else
15 growl "Tests", "#{output}", "~/.ruby_ok.png"
16 end
17 end
18 end
19 end
Something went wrong with that request. Please try again.