Sha256: 45b4d37508ef417d02842ecf6d729517a05f04cd8ea2eb4656436687666bc2d5

Contents?: true

Size: 353 Bytes

Versions: 6

Compression:

Stored size: 353 Bytes

Contents

require 'spec_helper'

describe Hitimes do
  it "can time a block of code" do
    d = Hitimes.measure do
      sleep 0.2
    end
    d.should be_within(0.02).of(0.2)
  end

  it "raises an error if measure is called with no block" do
    lambda{ Hitimes.measure }.should raise_error( Hitimes::Error, /\ANo block given to Interval.measure\Z/ )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hitimes-1.2.1-java spec/hitimes_spec.rb
hitimes-1.2.1-x86-mswin32 spec/hitimes_spec.rb
hitimes-1.2.1 spec/hitimes_spec.rb
hitimes-1.2.0-x86-mswin32 spec/hitimes_spec.rb
hitimes-1.2.0-java spec/hitimes_spec.rb
hitimes-1.2.0 spec/hitimes_spec.rb