Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Forked from technicalpickles/.autotest
Created April 20, 2009 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bcardarella/98663 to your computer and use it in GitHub Desktop.
Save bcardarella/98663 to your computer and use it in GitHub Desktop.
Evil Autotest has Temper Tantrums
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file:
require 'rubygems'
require 'active_support'
class Autotest
def run_with_not_rerunning_everything
hook :initialize
reset
add_sigint_handler
self.last_mtime = Time.now if $f
loop do # ^c handler
begin
get_to_green
hook :all_good unless self.tainted
wait_for_changes
rescue Interrupt
break if self.wants_to_quit
reset
end
end
hook :quit
end
alias_method_chain :run, :not_rerunning_everything
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment