Created
January 2, 2009 02:04
-
-
Save itstommymorgan/42445 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
require 'autotest/redgreen' | |
require 'autotest/timestamp' | |
module Autotest::Naughty | |
def self.naughty_notify title, text | |
system "echo \"naughty.notify({title='#{title}', text='#{text}', timeout=10})\" | awesome-client -" | |
end | |
Autotest.add_hook :red do |at| | |
errors = at.files_to_test.map { |k, v| "#{k}:\n #{v.join("\n ")}"}.join("\n\n") | |
naughty_notify "Tests Failed:", errors | |
end | |
## Apparently the :red hook doesn't work, so :green is called every time a test finishes. | |
Autotest.add_hook :green do |at| | |
results = at.results[/\d+ tests.*$/] | |
naughty_notify "Test Results:", results | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment