Sha256: 079a1bf31198a9c56b7e79a9bf10e62a20d4c5ab4e5be3c816aea8c83bfa6b07

Contents?: true

Size: 301 Bytes

Versions: 21

Compression:

Stored size: 301 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.must_be_close_to(0.2, 0.002)
  end

  it "raises an error if measure is called with no block" do
    lambda{ Hitimes.measure }.must_raise( Hitimes::Error )
  end
end

Version data entries

21 entries across 19 versions & 4 rubygems

Version Path
hitimes-1.2.6-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.2.6-java spec/hitimes_spec.rb
hitimes-1.2.6 spec/hitimes_spec.rb
hitimes-1.2.5-java spec/hitimes_spec.rb
hitimes-1.2.5-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.2.5 spec/hitimes_spec.rb
hitimes-1.2.4-java spec/hitimes_spec.rb
hitimes-1.2.4-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.2.4 spec/hitimes_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/hitimes-1.2.2/spec/hitimes_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/hitimes-1.2.2/spec/hitimes_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/hitimes-1.2.2/spec/hitimes_spec.rb
hitimes-1.2.3-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.2.3-java spec/hitimes_spec.rb
hitimes-1.2.3 spec/hitimes_spec.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/hitimes-1.2.2/spec/hitimes_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/hitimes-1.2.2/spec/hitimes_spec.rb
hitimes-1.2.2-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.2.2-x86-mswin32-60 spec/hitimes_spec.rb
hitimes-1.2.2-java spec/hitimes_spec.rb