Sha256: 91d74456e7d3dc3d97e13fd59bb1a67e6c4e493ab0d5128eab4fd4af9a258a7c

Contents?: true

Size: 771 Bytes

Versions: 10

Compression:

Stored size: 771 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe 'memcached storage' do
  before :all do
    Rack::PageSpeed::Config # load all storage mechanisms
    @store = Rack::PageSpeed::Store::Memcached.new
    @client = @store.instance_variable_get(:@client)
  end
  
  context 'initializing' do
    it "errors out if it can't connect to Memcached" do
      expect { MemcachedStore.new('ohfoo').new }.to raise_error
    end
  end
  
  context 'writing' do
    it "writes with a Hash-like syntax" do
      @client.should_receive(:set).with('omg', 'value')
      @store['omg'] = "value"
    end
  end
  
  context 'reading' do
    it "reads with a Hash-like syntax" do
      @client.set 'hola', 'Hola mundo'
      @store['hola'].should == "Hola mundo"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rack-pagespeed-1.0.7 spec/store/memcached_spec.rb
rack-pagespeed-1.0.6 spec/store/memcached_spec.rb
rack-pagespeed-1.0.5 spec/store/memcached_spec.rb
rack-pagespeed-1.0.4 spec/store/memcached_spec.rb
rack-pagespeed-1.0.3 spec/store/memcached_spec.rb
rack-pagespeed-1.0.2 spec/store/memcached_spec.rb
rack-pagespeed-1.0.1 spec/store/memcached_spec.rb
rack-pagespeed-1.0.0 spec/store/memcached_spec.rb
rack-pagespeed-0.2.0 spec/store/memcached_spec.rb
rack-pagespeed-0.1.0 spec/store/memcached_spec.rb