Sha256: b9e2f83c1298098df5de0e3f46de919a546fbb480880ad741fc3ce989da4745d
Contents?: true
Size: 644 Bytes
Versions: 14
Compression:
Stored size: 644 Bytes
Contents
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com # All files in this distribution are subject to the terms of the Ruby license. require File.expand_path('../../../../spec/helper', __FILE__) 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
14 entries across 14 versions & 3 rubygems