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