Sha256: 78a5f54a30a8f271580e52ab0173e9958fdf805b5723b21fcca31cfa177aabdc

Contents?: true

Size: 497 Bytes

Versions: 24

Compression:

Stored size: 497 Bytes

Contents

require 'spec_helper'

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

  it "returns the (key, value) pairs stored in the hash" do
    @redises.hgetall(@key).should == {
      'k1' => 'v1',
      'k2' => 'v2',
    }
  end

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

  it_should_behave_like "a hash-only command"
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
mock_redis-0.6.5 spec/commands/hgetall_spec.rb
mock_redis-0.6.4 spec/commands/hgetall_spec.rb
mock_redis-0.6.3 spec/commands/hgetall_spec.rb
mock_redis-0.6.2 spec/commands/hgetall_spec.rb
mock_redis-0.6.1 spec/commands/hgetall_spec.rb
mock_redis-0.6.0 spec/commands/hgetall_spec.rb
mock_redis-0.5.5 spec/commands/hgetall_spec.rb
mock_redis-0.5.4 spec/commands/hgetall_spec.rb
mock_redis-0.5.3 spec/commands/hgetall_spec.rb
mock_redis-0.5.2 spec/commands/hgetall_spec.rb
mock_redis-0.5.1 spec/commands/hgetall_spec.rb
mock_redis-0.5.0 spec/commands/hgetall_spec.rb
mock_redis-0.4.1 spec/commands/hgetall_spec.rb
mock_redis-0.4.0 spec/commands/hgetall_spec.rb
mock_redis-0.3.0 spec/commands/hgetall_spec.rb
ryansch-mock_redis-0.3.0 spec/commands/hgetall_spec.rb
ryansch-mock_redis-0.2.0.2 spec/commands/hgetall_spec.rb
ryansch-mock_redis-0.2.0.1 spec/commands/hgetall_spec.rb
mock_redis-0.2.0 spec/commands/hgetall_spec.rb
mock_redis-0.1.2 spec/commands/hgetall_spec.rb