Sha256: fdd682e642621b6e3c4c5ab3aebcce770f5b552250debd6037701591afe5618d

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

# Generated by generate.rb
require 'helper'

describe_moneta "adapter_redis" do
  def new_store
    Moneta::Adapters::Redis.new
  end

  def load_value(value)
    Marshal.load(value)
  end

  include_context 'setup_store'
  it_should_behave_like 'expires'
  it_should_behave_like 'increment'
  it_should_behave_like 'null_stringkey_stringvalue'
  it_should_behave_like 'persist_stringkey_stringvalue'
  it_should_behave_like 'returndifferent_stringkey_stringvalue'
  it_should_behave_like 'store_stringkey_stringvalue'
  it 'supports default expiration time' do
    store = Moneta::Adapters::Redis.new(:expires => 2)
    store.store('key1', 'val1')
    store.store('key2', 'val2', :expires => 60)
    store.load('key1').should == 'val1'
    sleep 1
    store.load('key1').should == 'val1'
    sleep 2
    store.load('key1').should be_nil
    store['key2'].should == 'val2'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
moneta-0.7.3 spec/moneta/adapter_redis_spec.rb
moneta-0.7.2 spec/moneta/adapter_redis_spec.rb