Sha256: 797ea363c1e1d70507f19f9173bbae4ef7e858285a9b14cf994808376118dda8
Contents?: true
Size: 706 Bytes
Versions: 29
Compression:
Stored size: 706 Bytes
Contents
require 'spec_helper' describe '#rpop(key)' do before { @key = 'mock-redis-test:43093' } it 'returns and removes the first element of a list' do @redises.lpush(@key, 1) @redises.lpush(@key, 2) @redises.rpop(@key).should == '1' @redises.llen(@key).should == 1 end it 'returns nil if the list is empty' do @redises.lpush(@key, 'foo') @redises.rpop(@key) @redises.rpop(@key).should be_nil end it 'returns nil for nonexistent values' do @redises.rpop(@key).should be_nil end it 'removes empty lists' do @redises.lpush(@key, 'foo') @redises.rpop(@key) @redises.get(@key).should be_nil end it_should_behave_like 'a list-only command' end
Version data entries
29 entries across 29 versions & 1 rubygems