Sha256: a422fcf355e07859b812baff6c905c08488992613b41960e085ed99270c87794

Contents?: true

Size: 420 Bytes

Versions: 27

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 = 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)
end

Version data entries

27 entries across 27 versions & 6 rubygems

Version Path
tpitale-mongo_mapper-0.6.9 test/support/timing.rb
mongo_mapper-unstable-2009.12.29 test/support/timing.rb
mongo_mapper-unstable-2009.12.23 test/support/timing.rb
mongo_mapper-unstable-2009.12.22 test/support/timing.rb
mongo_mapper-unstable-2009.12.16 test/support/timing.rb
mongo_mapper-0.6.8 test/support/timing.rb
mongo_mapper-unstable-2009.12.14 test/support/timing.rb
mongo_mapper-0.6.7 test/support/timing.rb
mongo_mapper-0.6.6 test/support/timing.rb
mongo_mapper-unstable-2009.12.4 test/support/timing.rb
danielharan-mongo_mapper-0.6.5 test/support/timing.rb
mongo_mapper-0.6.5 test/support/timing.rb
webbynode-mongo_mapper-0.6.4 test/support/timing.rb
mongo_mapper-0.6.4 test/support/timing.rb
mongo_mapper-0.6.3 test/support/timing.rb
mongo_mapper-0.6.2 test/support/timing.rb
mongo_mapper-0.6.1 test/support/timing.rb
mongo_mapper-unstable-2009.11.18 test/support/timing.rb
mongo_mapper-0.6.0 test/support/timing.rb
mongo_mapper-unstable-2009.11.8 test/support/timing.rb