Sha256: a9c4c043c2c72da682881e4ca139cc23e2673cf058d49c9efdf5b9331c160c16
Contents?: true
Size: 769 Bytes
Versions: 4
Compression:
Stored size: 769 Bytes
Contents
require 'spec_helper' describe '#lpop(key)' do before { @key = 'mock-redis-test:65374' } it 'returns and removes the first element of a list' do @redises.lpush(@key, 1) @redises.lpush(@key, 2) @redises.lpop(@key).should == '2' @redises.llen(@key).should == 1 end it 'returns nil if the list is empty' do @redises.lpush(@key, 'foo') @redises.lpop(@key) @redises.lpop(@key).should be_nil end it 'returns nil for nonexistent values' do @redises.lpop(@key).should be_nil end it 'removes empty lists' do @redises.lpush(@key, 'foo') @redises.lpop(@key) @redises.get(@key).should be_nil end let(:default_error) { RedisMultiplexer::MismatchedResponse } it_should_behave_like 'a list-only command' end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
mock_redis-0.36.0 | spec/commands/lpop_spec.rb |
mock_redis-0.35.0 | spec/commands/lpop_spec.rb |
mock_redis-0.34.0 | spec/commands/lpop_spec.rb |
mock_redis-0.33.0 | spec/commands/lpop_spec.rb |