Created
August 22, 2010 08:25
-
-
Save Oshuma/543528 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
#!/usr/bin/env ruby | |
def run_specs | |
system('rake spec') | |
end | |
# Ctrl-\ | |
Signal.trap('QUIT') do | |
puts "\n--- Running all specs ---\n" | |
run_specs | |
end | |
# Ctrl-C | |
Signal.trap('INT') { abort("\n") } | |
if __FILE__ == $0 | |
system("watchr #{$0}") | |
else | |
run_specs | |
[ | |
'lib/(.*/)?.*\.rb', | |
'spec/(.*/)?.*_spec\.rb' | |
].each do |pattern| | |
watch(pattern) { |md| run_specs } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment