Created
April 9, 2009 15:23
-
-
Save ajmorris/92529 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .autotest | |
require 'autotest/redgreen' | |
require 'autotest/menu' | |
# This replaces the stock Autotest::Growl | |
module Autotest::Growl | |
def self.growl title, msg, image=nil, pri=0 | |
title += " in #{Dir.pwd}" | |
msg += " at #{Time.now}" | |
system "growlnotify -n autotest --image #{image || "/Applications/Mail.app/Contents/Resources/Caution.tiff"} -m #{msg.inspect} -t #{title}" | |
end | |
Autotest.add_hook :initialize do |at| | |
growl "autotest running", "Started",'~/Library/autotest/rails_grey.png' | |
end | |
Autotest.add_hook :reset do |at| | |
growl "autotest reset", "Reset",'~/Library/autotest/rails_grey.png' | |
end | |
Autotest.add_hook :red do |at| | |
growl "Tests Failed", "#{at.files_to_test.size} tests failed", '~/Library/autotest/rails_fail.png' | |
end | |
Autotest.add_hook :green do |at| | |
growl "Tests Passed", "#{at.results.scan(at.completed_re)}", '~/Library/autotest/rails_ok.png' | |
end | |
Autotest.add_hook :all_good do |at| | |
growl "All Tests Passed", "#{at.results.scan(at.completed_re)}", '~/Library/autotest/rails_ok.png' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment