Sha256: 5af687b2d04aa0d496ef66fddbb076b9e0fa390dfa65dd0cce8547099120846a

Contents?: true

Size: 582 Bytes

Versions: 33

Compression:

Stored size: 582 Bytes

Contents

require 'spec_helper'

describe '#zscore(key, member)' do
  before { @key = 'mock-redis-test:zscore' }

  it 'returns the score as a string' do
    @redises.zadd(@key, 0.25, 'foo').should == true
    @redises.zscore(@key, 'foo').should == 0.25
  end

  it 'handles integer members correctly' do
    member = 11
    @redises.zadd(@key, 0.25, member).should == true
    @redises.zscore(@key, member).should == 0.25
  end

  it 'returns nil if member is not present in the set' do
    @redises.zscore(@key, 'foo').should be_nil
  end

  it_should_behave_like 'a zset-only command'
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
mock_redis-0.36.0 spec/commands/zscore_spec.rb
mock_redis-0.35.0 spec/commands/zscore_spec.rb
mock_redis-0.34.0 spec/commands/zscore_spec.rb
mock_redis-0.33.0 spec/commands/zscore_spec.rb
mock_redis-0.32.0 spec/commands/zscore_spec.rb
mock_redis-0.31.0 spec/commands/zscore_spec.rb
mock_redis-0.30.0 spec/commands/zscore_spec.rb
mock_redis-0.29.0 spec/commands/zscore_spec.rb
mock_redis-0.28.0 spec/commands/zscore_spec.rb
mock_redis-0.27.3 spec/commands/zscore_spec.rb
mock_redis-0.27.2 spec/commands/zscore_spec.rb
mock_redis-0.27.1 spec/commands/zscore_spec.rb
mock_redis-0.27.0 spec/commands/zscore_spec.rb
mock_redis-0.26.0 spec/commands/zscore_spec.rb
mock_redis-0.25.0 spec/commands/zscore_spec.rb
mock_redis-0.24.0 spec/commands/zscore_spec.rb
mock_redis-0.23.0 spec/commands/zscore_spec.rb
mock_redis-0.22.0 spec/commands/zscore_spec.rb
mock_redis-0.21.0 spec/commands/zscore_spec.rb
mock_redis-0.20.0 spec/commands/zscore_spec.rb