Sha256: e4c85a215b29fe6b5eb639da9fba49eb36744b0611e5dc631cf223fe25f701a9

Contents?: true

Size: 617 Bytes

Versions: 11

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

11 entries across 11 versions & 1 rubygems

Version Path
mock_redis-0.17.3 spec/commands/hset_spec.rb
mock_redis-0.17.2 spec/commands/hset_spec.rb
mock_redis-0.17.1 spec/commands/hset_spec.rb
mock_redis-0.17.0 spec/commands/hset_spec.rb
mock_redis-0.16.1 spec/commands/hset_spec.rb
mock_redis-0.16.0 spec/commands/hset_spec.rb
mock_redis-0.15.4 spec/commands/hset_spec.rb
mock_redis-0.15.3 spec/commands/hset_spec.rb
mock_redis-0.15.2 spec/commands/hset_spec.rb
mock_redis-0.15.1 spec/commands/hset_spec.rb
mock_redis-0.15.0 spec/commands/hset_spec.rb