Skip to content

Instantly share code, notes, and snippets.

@edward
Created June 25, 2009 18:28
Show Gist options
  • Save edward/136058 to your computer and use it in GitHub Desktop.
Save edward/136058 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# sudo gem install ZenTest
# run "autotest", or "autotest -f" to skip the initial full test suite
# colour coded results
require 'autotest/redgreen'
# growl notifications...put something like this in ~/.autotest if you want
# module Autotest::Growl
#
# def self.growl title, msg, pri = 0, img = nil
# title += " in #{Dir.pwd.split(/\//).last(3).join("/")}"
# msg += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"
# # TODO: parameterize default image
# img ||= "/Applications/Mail.app/Contents/Resources/Caution.tiff"
# cmd = "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title}"
# system cmd
# end
#
# Autotest.add_hook :initialize do |at|
# growl "autotest running", "Started"
# 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", "Tests passed", -2 if at.tainted
# end
#
# Autotest.add_hook :all_good do |at|
# growl "Tests Passed", "All tests passed", -2 if at.tainted
# end
# end
class Autotest
def rerun_all_tests
end
end
Autotest.add_hook :initialize do |at|
at.order = :natural # order of tests
at.unit_diff = 'cat' # don't do unit_diff
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment