Sha256: f1f0d886b7cb4a55781cfcfbc25905e5bcc84377255c2fcfb18f1e1dabc323af

Contents?: true

Size: 492 Bytes

Versions: 39

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

39 entries across 39 versions & 2 rubygems

Version Path
mock_redis-0.14.1 spec/commands/spop_spec.rb
mock_redis-0.14.0 spec/commands/spop_spec.rb
mock_redis-0.13.2 spec/commands/spop_spec.rb
mock_redis-0.13.1 spec/commands/spop_spec.rb
mock_redis-0.13.0 spec/commands/spop_spec.rb
mock_redis-0.12.1 spec/commands/spop_spec.rb
mock_redis-0.12.0 spec/commands/spop_spec.rb
mock_redis-0.11.0 spec/commands/spop_spec.rb
mock_redis-0.10.0 spec/commands/spop_spec.rb
mock_redis-0.9.0 spec/commands/spop_spec.rb
mock_redis-0.8.2 spec/commands/spop_spec.rb
mock_redis-0.8.1 spec/commands/spop_spec.rb
mock_redis-0.8.0 spec/commands/spop_spec.rb
mock_redis-0.7.0 spec/commands/spop_spec.rb
mock_redis-0.6.6 spec/commands/spop_spec.rb
mock_redis-0.6.5 spec/commands/spop_spec.rb
mock_redis-0.6.4 spec/commands/spop_spec.rb
mock_redis-0.6.3 spec/commands/spop_spec.rb
mock_redis-0.6.2 spec/commands/spop_spec.rb
mock_redis-0.6.1 spec/commands/spop_spec.rb