Sha256: 6c69e252a8b627290c99e9ade7184c871d05fb6adbea0328446119b284dd9826

Contents?: true

Size: 434 Bytes

Versions: 39

Compression:

Stored size: 434 Bytes

Contents

require 'spec_helper'

describe "#hlen(key)" do
  before do
    @key = "mock-redis-test:hlen"
    @redises.hset(@key, 'k1', 'v1')
    @redises.hset(@key, 'k2', 'v2')
  end

  it "returns the number of keys stored in the hash" do
    @redises.hlen(@key).should == 2
  end

  it "returns [] when there is no such key" do
    @redises.hlen('mock-redis-test:nonesuch').should == 0
  end

  it_should_behave_like "a hash-only command"
end

Version data entries

39 entries across 39 versions & 2 rubygems

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