Sha256: a40bb64c359c4a2765a2814d0ab70bdb06319112fad19d0ec7172a6505627f0c

Contents?: true

Size: 454 Bytes

Versions: 8

Compression:

Stored size: 454 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
    # output between ruby 1.8 and 1.9 differs...
    log.pop.should =~ %r!^Bench #{__FILE__}:#{__LINE__ - 4}:.* \d\.\d+$!
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
manveru-ramaze-2009.06.04 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.06.12 spec/ramaze/helper/bench.rb
manveru-ramaze-2009.06 spec/ramaze/helper/bench.rb
rjspotter-ramaze-2009.06.29 spec/ramaze/helper/bench.rb
rjspotter-ramaze-2009.06.31 spec/ramaze/helper/bench.rb
ramaze-2009.06 spec/ramaze/helper/bench.rb
ramaze-2009.06.12 spec/ramaze/helper/bench.rb
ramaze-2009.06.04 spec/ramaze/helper/bench.rb