Sha256: 360b36d2bd04539e2a27a3dbf5ce9f00aadc349cd14bbb66cd5ddaf15ef247d3

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

require 'spec_helper'

describe Picky::Backends::Redis::ListHash 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::ListHash(some_namespace:*)'
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
picky-3.1.0 spec/lib/backends/redis/list_hash_spec.rb