Created
August 2, 2012 15:52
-
-
Save owainlewis/3238087 to your computer and use it in GitHub Desktop.
watchr for test unit
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 method_missing(meth, *args, &block) | |
if meth.to_s =~ /^run_(.+)$/ | |
system 'clear' | |
system "rake test:#{$1}" | |
else | |
super | |
end | |
end | |
def clear | |
system "clear" | |
end | |
watch('test/unit/.*_test.rb') {|md| run_units md[0] } | |
watch('test/functional/.*_test.rb') {|md| run_functionals md[0] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment