Skip to content

Instantly share code, notes, and snippets.

@fantactuka
Created July 30, 2011 10:42
Show Gist options
  • Save fantactuka/1115402 to your computer and use it in GitHub Desktop.
Save fantactuka/1115402 to your computer and use it in GitHub Desktop.
Rerun all tests after changed tests passed
# encoding: utf-8
require "test_notifier/runner/autotest"
class Autotest
alias :original_get_to_green :get_to_green
def get_to_green
original_get_to_green
rerun_all_tests
end
end
Autotest.add_discovery do
"rspec2"
end
Autotest.add_hook(:initialize) do |at|
at.add_exception %r{^\.git} # ignore Version Control System
at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again...
at.add_mapping(%r{^lib/.*\.rb$}) do
Dir['spec/**/*_spec.rb']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment