Sha256: 928a51cce4d9744025f3635b48eb5c6e2871e62925aa12ac007673e72ab4acb3
Contents?: true
Size: 943 Bytes
Versions: 15
Compression:
Stored size: 943 Bytes
Contents
require 'spec_helper' describe Internals::Index::Redis::ListHash do let(:index) { described_class.new :some_namespace } describe 'member' do it 'raises an error' do expect { index.member :some_sym }.to raise_error("Can't retrieve a single value from a Redis ListHash. Use Index::Redis::StringHash.") end end describe 'collection' do it 'returns whatever comes back from the backend' do backend = stub :backend index.should_receive(:backend).and_return backend backend.stub! :lrange => :some_lrange_result index.collection(:anything).should == :some_lrange_result end it 'calls the right method on the backend' do backend = stub :backend index.should_receive(:backend).and_return backend backend.should_receive(:lrange).once.with "some_namespace:some_sym", 0, -1 index.collection :some_sym end end end
Version data entries
15 entries across 15 versions & 1 rubygems