Sha256: 7239832083aab5eac0a7b0e1e4b6c4d11e81bdbf59f6855fbde1dd280975a05a
Contents?: true
Size: 1.06 KB
Versions: 25
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' describe '#zrem(key, member)' do before do @key = 'mock-redis-test:zrem' @redises.zadd(@key, 1, 'one') @redises.zadd(@key, 2, 'two') end it 'returns true if member is present in the set' do @redises.zrem(@key, 'one').should == true end it 'returns false if member is not present in the set' do @redises.zrem(@key, 'nobody home').should == false end it 'removes member from the set' do @redises.zrem(@key, 'one') @redises.zrange(@key, 0, -1).should == ['two'] end it 'removes integer member from the set' do member = 11 @redises.zadd(@key, 3, member) @redises.zrem(@key, member).should == true @redises.zrange(@key, 0, -1).should == %w[one two] end it 'supports a variable number of arguments' do @redises.zrem(@key, %w[one two]) @redises.zrange(@key, 0, -1).should be_empty end it 'raises an error if member is an empty array' do lambda do @redises.zrem(@key, []) end.should raise_error(Redis::CommandError) end it_should_behave_like 'a zset-only command' end
Version data entries
25 entries across 25 versions & 1 rubygems