Sha256: 3fbd27e1223b8f1ccb516605b15b77e0fcb1f1b2ee08fd64d37d879c46fed63b
Contents?: true
Size: 562 Bytes
Versions: 56
Compression:
Stored size: 562 Bytes
Contents
require 'core/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
56 entries across 56 versions & 1 rubygems