Sha256: e6c503f717f4987c3a355ac988886dd37f432eeca1a5e2e912d2852deab4098d

Contents?: true

Size: 492 Bytes

Versions: 13

Compression:

Stored size: 492 Bytes

Contents

require 'spec_helper'

describe '#spop(key)' do
  before do
    @key = 'mock-redis-test:spop'

    @redises.sadd(@key, 'value')
  end

  it 'returns a member of the set' do
    @redises.spop(@key).should == 'value'
  end

  it 'removes a member of the set' do
    @redises.spop(@key)
    @redises.smembers(@key).should == []
  end

  it 'returns nil if the set is empty' do
    @redises.spop(@key)
    @redises.spop(@key).should be_nil
  end

  it_should_behave_like 'a set-only command'
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mock_redis-0.19.0 spec/commands/spop_spec.rb
mock_redis-0.18.0 spec/commands/spop_spec.rb
mock_redis-0.17.3 spec/commands/spop_spec.rb
mock_redis-0.17.2 spec/commands/spop_spec.rb
mock_redis-0.17.1 spec/commands/spop_spec.rb
mock_redis-0.17.0 spec/commands/spop_spec.rb
mock_redis-0.16.1 spec/commands/spop_spec.rb
mock_redis-0.16.0 spec/commands/spop_spec.rb
mock_redis-0.15.4 spec/commands/spop_spec.rb
mock_redis-0.15.3 spec/commands/spop_spec.rb
mock_redis-0.15.2 spec/commands/spop_spec.rb
mock_redis-0.15.1 spec/commands/spop_spec.rb
mock_redis-0.15.0 spec/commands/spop_spec.rb