Sha256: 1762a007cab3fd11f3c13cf5cc209e480e722627f98f558ed2cd52b0a01790c2

Contents?: true

Size: 640 Bytes

Versions: 12

Compression:

Stored size: 640 Bytes

Contents

require 'spec_helper'

describe "#zcount(key, min, max)" do
  before do
    @key = 'mock-redis-test:zcount'
    @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 members in the zset with scores in (min..max)" do
    @redises.zcount(@key, 3, 10).should == 2
  end

  it "returns 0 if there are no such members" do
    @redises.zcount(@key, 100, 200).should == 0
  end

  it_should_behave_like "arg 1 is a score"
  it_should_behave_like "arg 2 is a score"
  it_should_behave_like "a zset-only command"
end

Version data entries

12 entries across 12 versions & 2 rubygems

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