Sha256: ea134de7a23d7ed0ecc13767a09f24f2a9db531d0a50a7d1f31ff9717e19ba72

Contents?: true

Size: 377 Bytes

Versions: 5

Compression:

Stored size: 377 Bytes

Contents

# coding: utf-8
require 'spec_helper'

describe HTTPClient::LRUCache do
  before :each do
    @cache = subject.class.new(ttl: 3, max_size: 2, soft_ttl: 2)
  end
  
  it 'expires values' do
    @cache.fetch 'test' do
      2
    end.should eq 2
    @cache.fetch 'test' do
      3
    end.should eq 2
    sleep 4
    @cache.fetch 'test' do
      4
    end.should eq 4
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
glebtv-httpclient-3.2.7 spec/lru_spec.rb
glebtv-httpclient-3.2.6 spec/lru_spec.rb
glebtv-httpclient-3.2.4 spec/lru_spec.rb
glebtv-httpclient-3.2.3 spec/lru_spec.rb
glebtv-httpclient-3.2.2 spec/lru_spec.rb