Sha256: 9b005ca44457d484eaa8e05d61bb1c60f74ae89765164eb9804ecd2cfd71c96f

Contents?: true

Size: 793 Bytes

Versions: 33

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

describe '#zincrby(key, increment, member)' do
  before do
    @key = 'mock-redis-test:zincrby'
    @redises.zadd(@key, 1, 'bert')
  end

  it 'returns the new score as a string' do
    @redises.zincrby(@key, 10, 'bert').should == 11.0
  end

  it "updates the item's score" do
    @redises.zincrby(@key, 10, 'bert')
    @redises.zscore(@key, 'bert').should == 11.0
  end

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

  it 'adds missing members with score increment' do
    @redises.zincrby(@key, 5.5, 'bigbird').should == 5.5
  end

  it_should_behave_like 'arg 1 is a score'
  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/zincrby_spec.rb
mock_redis-0.35.0 spec/commands/zincrby_spec.rb
mock_redis-0.34.0 spec/commands/zincrby_spec.rb
mock_redis-0.33.0 spec/commands/zincrby_spec.rb
mock_redis-0.32.0 spec/commands/zincrby_spec.rb
mock_redis-0.31.0 spec/commands/zincrby_spec.rb
mock_redis-0.30.0 spec/commands/zincrby_spec.rb
mock_redis-0.29.0 spec/commands/zincrby_spec.rb
mock_redis-0.28.0 spec/commands/zincrby_spec.rb
mock_redis-0.27.3 spec/commands/zincrby_spec.rb
mock_redis-0.27.2 spec/commands/zincrby_spec.rb
mock_redis-0.27.1 spec/commands/zincrby_spec.rb
mock_redis-0.27.0 spec/commands/zincrby_spec.rb
mock_redis-0.26.0 spec/commands/zincrby_spec.rb
mock_redis-0.25.0 spec/commands/zincrby_spec.rb
mock_redis-0.24.0 spec/commands/zincrby_spec.rb
mock_redis-0.23.0 spec/commands/zincrby_spec.rb
mock_redis-0.22.0 spec/commands/zincrby_spec.rb
mock_redis-0.21.0 spec/commands/zincrby_spec.rb
mock_redis-0.20.0 spec/commands/zincrby_spec.rb