Sha256: 6c7ad6b98ea9e9a8d25d8fd2334b85f38526e7a2bed817edb52ec6172589d7d1

Contents?: true

Size: 709 Bytes

Versions: 91

Compression:

Stored size: 709 Bytes

Contents

require 'spec_helper'

describe Picky::Backends::Redis::List do

  let(:client) { stub :client }
  let(:index) { described_class.new client, :some_namespace }

  describe '[]' do
    it 'returns whatever comes back from the backend' do
      client.stub! :zrange => [:some_lrange_result]

      index[:anything].should == [:some_lrange_result]
    end
    it 'calls the right method on the backend' do
      client.should_receive(:zrange).once.with "some_namespace:some_sym", :"0", :"-1"

      index[:some_sym]
    end
  end

  describe 'to_s' do
    it 'returns the cache path with the default file extension' do
      index.to_s.should == 'Picky::Backends::Redis::List(some_namespace:*)'
    end
  end

end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
picky-4.19.4 spec/lib/backends/redis/list_spec.rb
picky-4.19.3 spec/lib/backends/redis/list_spec.rb
picky-4.19.2 spec/lib/backends/redis/list_spec.rb
picky-4.19.1 spec/lib/backends/redis/list_spec.rb
picky-4.19.0 spec/lib/backends/redis/list_spec.rb
picky-4.18.0 spec/lib/backends/redis/list_spec.rb
picky-4.17.1 spec/lib/backends/redis/list_spec.rb
picky-4.17.0 spec/lib/backends/redis/list_spec.rb
picky-4.16.0 spec/lib/backends/redis/list_spec.rb
picky-4.15.1 spec/lib/backends/redis/list_spec.rb
picky-4.15.0 spec/lib/backends/redis/list_spec.rb
picky-4.14.0 spec/lib/backends/redis/list_spec.rb
picky-4.13.1 spec/lib/backends/redis/list_spec.rb
picky-4.13.0 spec/lib/backends/redis/list_spec.rb
picky-4.12.13 spec/lib/backends/redis/list_spec.rb
picky-4.12.12 spec/lib/backends/redis/list_spec.rb
picky-4.12.11 spec/lib/backends/redis/list_spec.rb
picky-4.12.10 spec/lib/backends/redis/list_spec.rb
picky-4.12.8 spec/lib/backends/redis/list_spec.rb
picky-4.12.7 spec/lib/backends/redis/list_spec.rb