diff --git a/.autotest b/.autotest new file mode 100644 index 0000000..71188f2 --- /dev/null +++ b/.autotest @@ -0,0 +1,19 @@ +require 'autotest/redgreen' +require 'autotest/timestamp' + +module Autotest::Growl + def self.growl title, msg, img, pri=0, sticky="" + system "growlnotify -n autotest -d #{title} -I #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}" + end + + Autotest.add_hook :ran_command do |at| + unless at.results.empty? + output = at.results.last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?/) + if output =~ /[1-9]\sfailures?/ + growl "Tests", "#{output}", "~/.ruby_fail.png", 2, "-s" + else + growl "Tests", "#{output}", "~/.ruby_ok.png" + end + end + end +end \ No newline at end of file diff --git a/.ruby_fail.png b/.ruby_fail.png new file mode 100644 index 0000000..90b24a1 Binary files /dev/null and b/.ruby_fail.png differ diff --git a/.ruby_ok.png b/.ruby_ok.png new file mode 100644 index 0000000..6d257cd Binary files /dev/null and b/.ruby_ok.png differ