Sha256: 23d0e0a2af780d338e25ed38020f3f3cdcb5f991a46abe7e4bf74831403c9558
Contents?: true
Size: 557 Bytes
Versions: 12
Compression:
Stored size: 557 Bytes
Contents
require 'spec_helper' describe ZendeskAPI::LRUCache do let(:cache){ ZendeskAPI::LRUCache.new(2) } it "writes and reads" do cache.write("x", 1).should == 1 cache.read("x").should == 1 end it "drops" do cache.write("x", 1) cache.write("y", 1) cache.write("x", 1) cache.write("z", 1) cache.read("z").should == 1 cache.read("x").should == 1 cache.read("y").should == nil end it "fetches" do cache.fetch("x"){ 1 }.should == 1 cache.read("x").should == 1 cache.fetch("x"){ 2 }.should == 1 end end
Version data entries
12 entries across 12 versions & 1 rubygems