Sha256: a5379ecaf061c1e9aeed2779d2459ceca8685b7904c5734a9f6b8d82af93d3c4
Contents?: true
Size: 522 Bytes
Versions: 13
Compression:
Stored size: 522 Bytes
Contents
require 'minitest_helper' describe Datacenter::Cache do it 'Without expiration' do cache = Datacenter::Cache.new i = 0 3.times do cache.fetch(:key_1) { i += 1 }.must_equal 1 end end it 'Cached key' do cache = Datacenter::Cache.new 1000 i = 0 3.times do cache.fetch(:key_1) { i += 1 }.must_equal 1 end end it 'Expired key' do cache = Datacenter::Cache.new 0 i = 0 1.upto(3) do |n| cache.fetch(:key_1) { i += 1 }.must_equal n end end end
Version data entries
13 entries across 13 versions & 1 rubygems