Sha256: e8a0e42566e2c4cd367256ed3e6a9982e941423869e3c35cd4c2eaf39bafbc49

Contents?: true

Size: 594 Bytes

Versions: 10

Compression:

Stored size: 594 Bytes

Contents

require 'spec_helper'

describe "#zremrangebyrank(key, start, stop)" do
  before do
    @key = 'mock-redis-test:zremrangebyrank'
    @redises.zadd(@key, 1, 'Washington')
    @redises.zadd(@key, 2, 'Adams')
    @redises.zadd(@key, 3, 'Jefferson')
    @redises.zadd(@key, 4, 'Madison')
  end

  it "returns the number of elements in range" do
    @redises.zremrangebyrank(@key, 2, 3).should == 2
  end

  it "removes the elements" do
    @redises.zremrangebyrank(@key, 2, 3)
    @redises.zrange(@key, 0, -1).should == %w[Washington Adams]
  end

  it_should_behave_like "a zset-only command"
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mock_redis-0.3.0 spec/commands/zremrangebyrank_spec.rb
ryansch-mock_redis-0.3.0 spec/commands/zremrangebyrank_spec.rb
ryansch-mock_redis-0.2.0.2 spec/commands/zremrangebyrank_spec.rb
ryansch-mock_redis-0.2.0.1 spec/commands/zremrangebyrank_spec.rb
mock_redis-0.2.0 spec/commands/zremrangebyrank_spec.rb
mock_redis-0.1.2 spec/commands/zremrangebyrank_spec.rb
mock_redis-0.1.1 spec/commands/zremrangebyrank_spec.rb
mock_redis-0.1.0 spec/commands/zremrangebyrank_spec.rb
mock_redis-0.0.2 spec/commands/zremrangebyrank_spec.rb
mock_redis-0.0.1 spec/commands/zremrangebyrank_spec.rb