public
Description: A fully featured forum system compatible with Rails 2.3
Homepage: http://forum.frozenplague.net
Clone URL: git://github.com/radar/rboard.git
Click here to lend your support to: rboard and make a donation at www.pledgie.com !
rboard / .autotest
100644 19 lines (16 sloc) 0.596 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Autotest::Growl
 
   def self.growl title, msg, img, pri=0, sticky=""
     system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
   end
 
  Autotest.add_hook :ran_command do |at|
    results = [at.results].flatten.join("\n")
    output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+not implemented)?/)
      if output
        if $~[2].to_i > 0
          growl "FAIL", "#{output}", "~/.autotest_images/fail.png", 2
       else
         growl "Pass", "#{output}", "~/.autotest_images/pass.png"
       end
     end
   end
 end