Sha256: a80b006314fccddafdbeb4442b943eae4f39ec973c2bcf97226d13d3dcd64548

Contents?: true

Size: 636 Bytes

Versions: 18

Compression:

Stored size: 636 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Util::HashCounter do

  it "should return 0 for non existing key" do
    Util::HashCounter.new.get(:abc).should == 0
  end

  it "should increase the returned value on every put with the same key" do
    counter =Util::HashCounter.new
    counter.put(:abc)
    counter.get(:abc).should == 1
    counter.put(:abc)
    counter.get(:abc).should == 2
  end

  it "should only increase value for given key provided to put" do
    counter =Util::HashCounter.new
    counter.put(:abc)
    counter.get(:abc).should == 1
    counter.get(:def).should == 0
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
webmock-1.3.5 spec/util/hash_counter_spec.rb
webmock-1.3.4 spec/util/hash_counter_spec.rb
webmock-1.3.3 spec/util/hash_counter_spec.rb
webmock-1.3.2 spec/util/hash_counter_spec.rb
webmock-1.3.1 spec/util/hash_counter_spec.rb
webmock-1.3.0 spec/util/hash_counter_spec.rb
webmock-1.2.2 spec/util/hash_counter_spec.rb
webmock-1.2.1 spec/util/hash_counter_spec.rb
webmock-1.2.0 spec/util/hash_counter_spec.rb
webmock-1.1.0 spec/util/hash_counter_spec.rb
webmock-1.0.0 spec/util/hash_counter_spec.rb
webmock-0.9.1 spec/util/hash_counter_spec.rb
webmock-0.9.0 spec/util/hash_counter_spec.rb
webmock-0.8.2 spec/util/hash_counter_spec.rb
webmock-0.8.1 spec/util/hash_counter_spec.rb
webmock-0.8.0 spec/util/hash_counter_spec.rb
webmock-0.7.3 spec/util/hash_counter_spec.rb
webmock-0.7.2 spec/util/hash_counter_spec.rb