Sha256: a8303cddd7c0987b815d053b69eca89e27c5c373606674d893e170938d8c7077

Contents?: true

Size: 636 Bytes

Versions: 22

Compression:

Stored size: 636 Bytes

Contents

require 'spec_helper'

require "moneta/adapters/memory"

shared_examples_for "a read/write Moneta cache" do
  types = {
    "String" => ["key", "key2"],
    "Object" => [{:foo => :bar}, {:bar => :baz}]
  }

  types.each do |type, (key, key2)|
    it "reads from keys that are #{type}s like a Hash" do
      @cache[key].should == nil
    end
  end
end

describe "Moneta::Adapters::Memory" do
  #class EmptyMiddleware
    #include Moneta::Middleware
  #end

  before(:each) do
    @cache = Moneta::Builder.build do
      run Moneta::Adapters::Memory
    end
    @cache.clear
  end

  it_should_behave_like "a read/write Moneta cache"
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/cantango/moneta_spec.rb
cantango-0.9.4.6 spec/cantango/moneta_spec.rb
cantango-0.9.4.5 spec/cantango/moneta_spec.rb
cantango-0.9.4.3 spec/cantango/moneta_spec.rb
cantango-0.9.4.2 spec/cantango/moneta_spec.rb
cantango-0.9.4.1 spec/cantango/moneta_spec.rb
cantango-0.9.4 spec/cantango/moneta_spec.rb
cantango-0.9.3.2 spec/cantango/moneta_spec.rb
cantango-0.8.9.5 spec/cantango/moneta_spec.rb
cantango-0.8.9.4 spec/cantango/moneta_spec.rb
cantango-0.8.9.3 spec/cantango/moneta_spec.rb
cantango-0.8.9.2 spec/cantango/moneta_spec.rb
cantango-0.8.9.1 spec/cantango/moneta_spec.rb
cantango-0.8.9 spec/cantango/moneta_spec.rb
cantango-0.8.8.1 spec/cantango/moneta_spec.rb
cantango-0.8.8 spec/cantango/moneta_spec.rb
cantango-0.8.7 spec/cantango/moneta_spec.rb
cantango-0.8.6.2 spec/cantango/moneta_spec.rb
cantango-0.8.6.1 spec/cantango/moneta_spec.rb
cantango-0.8.6 spec/cantango/moneta_spec.rb