lib/tunemygc/spies/minitest.rb in tunemygc-1.0.34 vs lib/tunemygc/spies/minitest.rb in tunemygc-1.0.35

- old
+ new

@@ -3,15 +3,10 @@ require 'minitest' module TuneMyGc module Spies class Minitest < TuneMyGc::Spies::Base - def initialize - @tests_processed = 0 - @tests_limit = nil - end - def install MiniTest::Unit::TestCase.__send__(:include, hooks_module) TuneMyGc.log "hooked: minitest" end @@ -22,14 +17,14 @@ TuneMyGc.log "uninstalled minitest spy" end def check_uninstall if ENV["RUBY_GC_TUNE_TESTS"] - @tests_limit ||= Integer(ENV["RUBY_GC_TUNE_TESTS"]) - @tests_processed += 1 - if @tests_processed == @tests_limit + @limit ||= Integer(ENV["RUBY_GC_TUNE_TESTS"]) + @processed += 1 + if @processed == @limit uninstall - TuneMyGc.log "kamikaze after #{@tests_processed} of #{@tests_limit} tests" + TuneMyGc.log "kamikaze after #{@processed} of #{@limit} tests" end end end def hooks_module \ No newline at end of file