Created
April 11, 2013 19:51
-
-
Save bltavares/5366627 to your computer and use it in GitHub Desktop.
Guardfile for mocha
This file contains hidden or 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
# encoding: utf-8 | |
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
notification :terminal_notifier_guard | |
guard :shell, :all_on_start => true do | |
watch(/^(test|lib)\/.+/) do | |
status = `./node_modules/mocha/bin/mocha 2>&1`.force_encoding("utf-8") | |
if status =~ /failed/ | |
Notifier.notify("Failed", :title => "Some tests failed", :image => :failed) | |
else | |
Notifier.notify("Success", :title => "All green", :image => :success) | |
end | |
status | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment