forked from olbrich/ruby-units
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.autotest
36 lines (27 loc) · 932 Bytes
/
.autotest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- ruby -*-
module AutoGrowl
def self.growl title, msg, pri=0
system "growlnotify -n autotest --image /Applications/Mail.app/Contents/Resources/Caution.tiff -p #{pri} -m #{msg.inspect} #{title}"
end
Autotest.add_hook :run do |at|
growl "Run", "Run" unless $TESTING
end
Autotest.add_hook :red do |at|
growl "Tests Failed", "#{at.files_to_test.size} tests failed", 2
end
Autotest.add_hook :green do |at|
growl "Tests Passed", "All tests passed", -2 if at.tainted
end
Autotest.add_hook :init do |at|
growl "autotest", "autotest was started" unless $TESTING
end
Autotest.add_hook :interrupt do |at|
growl "autotest", "autotest was reset" unless $TESTING
end
Autotest.add_hook :quit do |at|
growl "autotest", "autotest is exiting" unless $TESTING
end
Autotest.add_hook :all do |at|_hook
growl "autotest", "Tests have fully passed", -2 unless $TESTING
end
end