Sha256: c86086f31087a9884bf86eefdb9dd63e660d40035d9fcc941d111b369e594728

Contents?: true

Size: 719 Bytes

Versions: 34

Compression:

Stored size: 719 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

34 entries across 34 versions & 1 rubygems

Version Path
picky-3.6.7 spec/lib/backends/redis/list_spec.rb
picky-3.6.6 spec/lib/backends/redis/list_spec.rb
picky-3.6.4 spec/lib/backends/redis/list_spec.rb
picky-3.6.3 spec/lib/backends/redis/list_spec.rb
picky-3.6.2 spec/lib/backends/redis/list_spec.rb
picky-3.6.1 spec/lib/backends/redis/list_spec.rb
picky-3.6.0 spec/lib/backends/redis/list_spec.rb
picky-3.5.4 spec/lib/backends/redis/list_spec.rb
picky-3.5.3 spec/lib/backends/redis/list_spec.rb
picky-3.5.2 spec/lib/backends/redis/list_spec.rb
picky-3.5.1 spec/lib/backends/redis/list_spec.rb
picky-3.5.0 spec/lib/backends/redis/list_spec.rb
picky-3.4.3 spec/lib/backends/redis/list_spec.rb
picky-3.4.2 spec/lib/backends/redis/list_spec.rb
picky-3.4.1 spec/lib/backends/redis/list_spec.rb
picky-3.4.0 spec/lib/backends/redis/list_spec.rb
picky-3.3.3 spec/lib/backends/redis/list_spec.rb
picky-3.3.2 spec/lib/backends/redis/list_spec.rb
picky-3.3.1 spec/lib/backends/redis/list_spec.rb
picky-3.3.0 spec/lib/backends/redis/list_spec.rb