diff --git a/lib/mock_redis/hash_methods.rb b/lib/mock_redis/hash_methods.rb index eeb83d7..688976d 100644 --- a/lib/mock_redis/hash_methods.rb +++ b/lib/mock_redis/hash_methods.rb @@ -94,7 +94,7 @@ def hmset(key, *kvpairs) assert_has_args(kvpairs, 'hmset') if kvpairs.length.odd? - raise Redis::CommandError, err_msg || 'ERR wrong number of arguments for HMSET' + raise Redis::CommandError, err_msg || 'ERR wrong number of arguments for \'hmset\' command' end kvpairs.each_slice(2) do |(k, v)| diff --git a/spec/commands/xadd_spec.rb b/spec/commands/xadd_spec.rb index 729edd8..ff299fc 100644 --- a/spec/commands/xadd_spec.rb +++ b/spec/commands/xadd_spec.rb @@ -14,20 +14,20 @@ it 'returns an id based on the timestamp' do t = Time.now.to_i - id = @redises.xadd(@key, key: 'value') - expect(@redises.xadd(@key, key: 'value')).to match(/#{t}\d{3}-0/) + id = @redises.xadd(@key, { key: 'value' }) + expect(@redises.xadd(@key, { key: 'value' })).to match(/#{t}\d{3}-0/) end it 'adds data with symbols' do - @redises.xadd(@key, symbol_key: :symbol_value) + @redises.xadd(@key, { symbol_key: :symbol_value }) expect(@redises.xrange(@key, '-', '+').last[1]) .to eq('symbol_key' => 'symbol_value') end it 'increments the sequence number with the same timestamp' do Timecop.freeze do - @redises.xadd(@key, key: 'value') - expect(@redises.xadd(@key, key: 'value')).to match(/\d+-1/) + @redises.xadd(@key, { key: 'value' }) + expect(@redises.xadd(@key, { key: 'value' })).to match(/\d+-1/) end end @@ -67,7 +67,7 @@ it 'caters for the current time being before the last time' do t = (Time.now.to_f * 1000).to_i + 2000 @redises.xadd(@key, { key: 'value' }, id: "#{t}-0") - expect(@redises.xadd(@key, key: 'value')).to match(/#{t}-1/) + expect(@redises.xadd(@key, { key: 'value' })).to match(/#{t}-1/) end it 'appends a sequence number if it is missing' do diff --git a/spec/commands/xlen_spec.rb b/spec/commands/xlen_spec.rb index 5fe8d43..eeaa509 100644 --- a/spec/commands/xlen_spec.rb +++ b/spec/commands/xlen_spec.rb @@ -14,9 +14,9 @@ it 'returns the number of items in the stream' do expect(@redises.xlen(@key)).to eq 0 - @redises.xadd(@key, key: 'value') + @redises.xadd(@key, { key: 'value' }) expect(@redises.xlen(@key)).to eq 1 - 3.times { @redises.xadd(@key, key: 'value') } + 3.times { @redises.xadd(@key, { key: 'value' }) } expect(@redises.xlen(@key)).to eq 4 end end