Sha256: 880b8bd042cb6a40d405a7ab71abd3ad0911459142e8626ff3f8c12ede31a92a

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

# Generated by generate.rb
require 'helper'

describe_moneta "cache_file_memory" do
  def new_store
    Moneta.build do
      use(:Cache) do
        backend { adapter :File, :dir => File.join(make_tempdir, "cache_file_memory") }
        cache { adapter :Memory }
      end
    end
  end

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

  include_context 'setup_store'
  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 'stores loaded values in cache' do
    store.backend['foo'] = 'bar'
    store.cache['foo'].should be_nil
    store['foo'].should == 'bar'
    store.cache['foo'].should == 'bar'
    store.backend.delete('foo')
    store['foo'].should == 'bar'
    store.delete('foo')
    store['foo'].should be_nil
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

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