Skip to content

Instantly share code, notes, and snippets.

@owainlewis
Created August 2, 2012 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owainlewis/3238087 to your computer and use it in GitHub Desktop.
Save owainlewis/3238087 to your computer and use it in GitHub Desktop.
watchr for test unit
#!/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