Sha256: 1791820c07344d7889d014ab66a9523ee6ea40f7e38b10082577ecdcaaac0986

Contents?: true

Size: 489 Bytes

Versions: 6

Compression:

Stored size: 489 Bytes

Contents

shared_examples :default_expires do
  it 'sets the default expiration time', default_expires: true do
    store['key1'] = 'val1'
    advance(t_res / 4.0) # sleep less than a single time-space
    store.key?('key1').should be true
    store.fetch('key1').should == 'val1'
    store.load('key1').should == 'val1'
    advance min_ttl
    2.times { advance_next_tick }
    store.key?('key1').should be false
    store.fetch('key1').should be_nil
    store.load('key1').should be_nil
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
moneta-1.5.2 spec/features/default_expires.rb
moneta-1.5.1 spec/features/default_expires.rb
moneta-1.5.0 spec/features/default_expires.rb
moneta-1.4.2 spec/features/default_expires.rb
moneta-1.4.1 spec/features/default_expires.rb
moneta-1.4.0 spec/features/default_expires.rb