Sha256: 0b70658be6c892c203a0875059c2f3b5e7b540f9609586d9ecda3603fbd0aea9

Contents?: true

Size: 415 Bytes

Versions: 33

Compression:

Stored size: 415 Bytes

Contents

require 'spec_helper'

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

  it 'returns 0 for an empty set' do
    @redises.scard(@key).should == 0
  end

  it 'returns the number of elements in the set' do
    @redises.sadd(@key, 'one')
    @redises.sadd(@key, 'two')
    @redises.sadd(@key, 'three')
    @redises.scard(@key).should == 3
  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/scard_spec.rb
mock_redis-0.35.0 spec/commands/scard_spec.rb
mock_redis-0.34.0 spec/commands/scard_spec.rb
mock_redis-0.33.0 spec/commands/scard_spec.rb
mock_redis-0.32.0 spec/commands/scard_spec.rb
mock_redis-0.31.0 spec/commands/scard_spec.rb
mock_redis-0.30.0 spec/commands/scard_spec.rb
mock_redis-0.29.0 spec/commands/scard_spec.rb
mock_redis-0.28.0 spec/commands/scard_spec.rb
mock_redis-0.27.3 spec/commands/scard_spec.rb
mock_redis-0.27.2 spec/commands/scard_spec.rb
mock_redis-0.27.1 spec/commands/scard_spec.rb
mock_redis-0.27.0 spec/commands/scard_spec.rb
mock_redis-0.26.0 spec/commands/scard_spec.rb
mock_redis-0.25.0 spec/commands/scard_spec.rb
mock_redis-0.24.0 spec/commands/scard_spec.rb
mock_redis-0.23.0 spec/commands/scard_spec.rb
mock_redis-0.22.0 spec/commands/scard_spec.rb
mock_redis-0.21.0 spec/commands/scard_spec.rb
mock_redis-0.20.0 spec/commands/scard_spec.rb