Sha256: 98ed2e66c99a5bdc11fb6207dad7c556f5a170517bb2f2746a0022183a0f3354

Contents?: true

Size: 692 Bytes

Versions: 33

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'

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

  it 'returns [] for an empty set' do
    @redises.smembers(@key).should == []
  end

  it "returns the set's members" do
    @redises.sadd(@key, 'Hello')
    @redises.sadd(@key, 'World')
    @redises.sadd(@key, 'Test')
    @redises.smembers(@key).should == %w[Test World Hello]
  end

  it 'returns unfrozen copies of the input' do
    input = 'a string'
    @redises.sadd(@key, input)
    output = @redises.smembers(@key).first

    expect(output).to eq input
    expect(output).to_not equal input
    expect(output).to_not be_frozen
  end

  it_should_behave_like 'a set-only command'
end

Version data entries

33 entries across 33 versions & 1 rubygems

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