Sha256: 9488ecbfc5594a18c55e4a0fd33b6dd8766b646e668d11e9473284f3d84f2eb7
Contents?: true
Size: 718 Bytes
Versions: 33
Compression:
Stored size: 718 Bytes
Contents
require 'spec_helper' describe '#zrank(key, member)' do before do @key = 'mock-redis-test:zrank' @redises.zadd(@key, 1, 'one') @redises.zadd(@key, 2, 'two') @redises.zadd(@key, 3, 'three') end it "returns nil if member wasn't present in the set" do @redises.zrank(@key, 'foo').should be_nil end it 'returns the index of the member in the set' do @redises.zrank(@key, 'one').should == 0 @redises.zrank(@key, 'two').should == 1 @redises.zrank(@key, 'three').should == 2 end it 'handles integer members correctly' do member = 11 @redises.zadd(@key, 4, member) @redises.zrank(@key, member).should == 3 end it_should_behave_like 'a zset-only command' end
Version data entries
33 entries across 33 versions & 1 rubygems