Sha256: 73d1b173a6ba79ad0498b5779af8200f39bc8a91c1d2eebc574461ccfd01895d

Contents?: true

Size: 420 Bytes

Versions: 11

Compression:

Stored size: 420 Bytes

Contents

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 = 5.0
    
    if duration > threshold
      puts "\nSLOW TEST: #{duration} - #{self.name}"
    end
  end
  
  alias_method_chain :run, :test_timing unless method_defined?(:run_without_test_timing)
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
mongo_mapper-0.7.5 test/support/timing.rb
mongo_mapper_ign-0.7.4 test/support/timing.rb
mongo_mapper-0.7.4 test/support/timing.rb
mongo_mapper-0.7.3 test/support/timing.rb
numon-0.0.1 test/support/timing.rb
mongo_mapper-0.7.2 test/support/timing.rb
mongo_mapper-0.7.1 test/support/timing.rb
mongo_mapper-unstable-2010.3.8 test/support/timing.rb
mongo_mapper-unstable-2010.3.5 test/support/timing.rb
mongo_mapper-unstable-2010.3.4 test/support/timing.rb
mongo_mapper-unstable-2010.3.3 test/support/timing.rb