mirror of https://github.com/bjeanes/dotfiles.git
added some autotest stuff
parent
9a0ca44c84
commit
ce4bca4d2a
|
@ -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
|
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Loading…
Reference in New Issue