Sha256: 82fe5b84d0f5dc07cf5959203fa7a2eac28ac5695676cf1707e9a672dd80a1da

Contents?: true

Size: 593 Bytes

Versions: 18

Compression:

Stored size: 593 Bytes

Contents

# encoding: UTF-8

class Test::Unit::TestCase
  def run_with_test_timing(*args, &block)    
    begin_time = Time.now
    run_without_test_timing(*args, &block)
    end_time = Time.now
 
    duration = end_time - begin_time
    threshold = 0.5
    
    if duration > threshold
      puts "\nSLOW TEST: #{duration} - #{self.name}"
    end
  end
  
  # alias_method_chain :run, :test_timing unless method_defined?(:run_without_test_timing)
  unless method_defined?(:run_without_test_timing)
    alias_method :run_without_test_timing, :run
    alias_method :run, :run_with_test_timing
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 test/support/timing.rb
spontaneous-0.2.0.beta9 test/support/timing.rb
spontaneous-0.2.0.beta8 test/support/timing.rb
spontaneous-0.2.0.beta7 test/support/timing.rb
spontaneous-0.2.0.beta6 test/support/timing.rb
spontaneous-0.2.0.beta5 test/support/timing.rb
spontaneous-0.2.0.beta4 test/support/timing.rb
spontaneous-0.2.0.beta3 test/support/timing.rb
spontaneous-0.2.0.beta2 test/support/timing.rb
spontaneous-0.2.0.beta1 test/support/timing.rb
spontaneous-0.2.0.alpha7 test/support/timing.rb
spontaneous-0.2.0.alpha6 test/support/timing.rb
spontaneous-0.2.0.alpha5 test/support/timing.rb
spontaneous-0.2.0.alpha4 test/support/timing.rb
spontaneous-0.2.0.alpha3 test/support/timing.rb
spontaneous-0.2.0.alpha2 test/support/timing.rb
spontaneous-0.2.0.alpha1 test/support/timing.rb
spontaneous-0.1.0.alpha1 test/support/timing.rb