Skip to content
Newer
Older
100644 25 lines (21 sloc) 525 Bytes
2e14a03 @steveklabnik Adding watchr for derp-driven development.
authored Feb 23, 2011
1 def growl(message)
2 growlnotify = `which growlnotify`.chomp
3 title = "Watchr Test Results"
4 passed = message.include?('0 failures, 0 errors')
5 severity = passed ? "-1" : "1"
6 options = "-w -n Watchr"
7 options << " -m '#{message}' '#{title}' -p #{severity}"
8 system %(#{growlnotify} #{options} &)
9 end
10
11 def run_all_tests
12 system('clear')
13 result = `rake test`
14 growl result.split("\n")[-3] rescue nil
15 puts result
16 end
17
18 watch("test/derp_test\.rb") do
19 run_all_tests
20 end
21
22 watch("lib/derp\.rb") do
23 run_all_tests
24 end
Something went wrong with that request. Please try again.