Created
November 16, 2010 15:55
-
-
Save jcontonio/701965 to your computer and use it in GitHub Desktop.
Watchr script for running Jasmine BDD as autotest
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
# Run me with: $ watchr watchr.rb | |
def run(cmd) | |
puts(cmd) | |
system(cmd) | |
end | |
def run_all_tests | |
cmd = "ruby run_specs.rb -f n -c" | |
run(cmd) | |
end | |
watch( '^spec/.*Spec\.js' ) { run_all_tests } | |
watch( '^src/.*\.js' ) { run_all_tests } | |
# Ctrl-\ | |
Signal.trap('QUIT') do | |
puts " --- Running all tests ---\n\n" | |
run_all_tests | |
end | |
# Ctrl-C | |
Signal.trap('INT') { abort("\n") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment