Sha256: 73cb4d37b1694950eb5e86b933495b84b4eb766eed6b9547a943f9db6a251650

Contents?: true

Size: 617 Bytes

Versions: 28

Compression:

Stored size: 617 Bytes

Contents

require 'spec_helper'

describe "#hset(key, field)" do
  before do
    @key = "mock-redis-test:hset"
  end

  it "returns true" do
    @redises.hset(@key, 'k1', 'v1').should == true
  end

  it "creates a hash there is no such field" do
    @redises.hset(@key, 'k1', 'v1')
    @redises.hget(@key, 'k1').should == 'v1'
  end

  it "stores values as strings" do
    @redises.hset(@key, "num", 1)
    @redises.hget(@key, 'num').should == "1"
  end

  it "stores fields as strings" do
    @redises.hset(@key, 1, "one")
    @redises.hget(@key, "1").should == "one"
  end

  it_should_behave_like "a hash-only command"
end

Version data entries

28 entries across 28 versions & 1 rubygems

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