Sha256: 00a0e89c040a8da5f0238f5761a89e07ec230f8531bad917d7e7965b4cf6c9b5

Contents?: true

Size: 401 Bytes

Versions: 10

Compression:

Stored size: 401 Bytes

Contents

require 'spec/helper'
require 'ramaze/helper/bench'

describe Ramaze::Helper::Bench do
  extend Ramaze::Helper::Bench

  log = []
  def log.info(arg); push(arg); end
  Ramaze::Log.loggers = [log]

  it 'logs running time' do
    result = bench{ sleep 0.1; 'result' }
    result.should == 'result'
    log.size.should == 1
    log.pop.should =~ %r!Bench #{__FILE__}:#{__LINE__ - 3}: \d\.\d+!
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
Pistos-ramaze-2009.04.08 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.04.01 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.04.08 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.04.18 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.04.22 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.04 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.05.08 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.05 spec/ramaze/helper/bench.rb
ramaze-2009.04 spec/ramaze/helper/bench.rb
ramaze-2009.05 spec/ramaze/helper/bench.rb