added some autotest stuff

pull/2/head
Bodaniel Jeanes 2008-08-14 17:49:51 +10:00
parent 9a0ca44c84
commit ce4bca4d2a
3 changed files with 19 additions and 0 deletions

19
.autotest 100644
View File

@ -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

BIN
.ruby_fail.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
.ruby_ok.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB