Sha256: df6d734f84287e49a2797b1ce6eac6cbcbe715cb47cb9eb0dacdd97fe1ab9b7e

Contents?: true

Size: 683 Bytes

Versions: 28

Compression:

Stored size: 683 Bytes

Contents

require 'spec_helper'

describe '#zscan' do
  let(:count) { 10 }
  let(:match) { '*' }
  let(:key) { 'mock-redis-test:zscan' }

  context 'when the zset does not exist' do
    it 'returns a 0 cursor and an empty collection' do
      expect(@redises.zscan(key, 0, count: count, match: match)).to eq(['0', []])
    end
  end

  context 'when the zset exists' do
    before do
      @redises.zadd(key, 1.0, 'member1')
      @redises.zadd(key, 2.0, 'member2')
    end

    it 'returns a 0 cursor and the collection' do
      result = @redises.zscan(key, 0)
      expect(result[0]).to eq('0')
      expect(result[1]).to match_array([['member1', 1.0], ['member2', 2.0]])
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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