Sha256: d4a223f68a408196a00d18d72791fe0c73a7d636100bb8b4d0d537d77d9124c6

Contents?: true

Size: 677 Bytes

Versions: 29

Compression:

Stored size: 677 Bytes

Contents

require 'spec_helper'

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

  it "returns values stored at key" do
    @redises.mapped_hmget(@key, 'k1', 'k2').should == {'k1' => 'v1', 'k2' => 'v2'}
  end

  it "returns nils for missing fields" do
    @redises.mapped_hmget(@key, 'k1', 'mock-redis-test:nonesuch').
      should == {'k1' => 'v1', 'mock-redis-test:nonesuch' => nil}
  end

  it "raises an error if given no fields" do
    lambda do
      @redises.mapped_hmget(@key)
    end.should raise_error(RuntimeError)
  end

  it_should_behave_like "a hash-only command"
end

Version data entries

29 entries across 29 versions & 1 rubygems

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