Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent behavior between Redis#hdel, MockRedis#hdel #167

Closed
khiav223577 opened this issue Jun 21, 2019 · 1 comment · Fixed by #168
Closed

inconsistent behavior between Redis#hdel, MockRedis#hdel #167

khiav223577 opened this issue Jun 21, 2019 · 1 comment · Fixed by #168
Labels

Comments

@khiav223577
Copy link

See the following examples:

Redis

redis = Redis.new

redis.hset('test_key', 'test_field1', 'test_value1')
# => true

redis.hset('test_key', 'test_field2', 'test_value2')
# => true

[redis.hget('test_key', 'test_field1'), redis.hget('test_key', 'test_field2')]
# => ["test_value1", "test_value2"]

redis.hdel('test_key', ['test_field1', 'test_field2'])
# => 2

[redis.hget('test_key', 'test_field1'), redis.hget('test_key', 'test_field2')]
# => [nil, nil]

MockRedis

redis = MockRedis.new

redis.hset('test_key', 'test_field1', 'test_value1')
# => true

redis.hset('test_key', 'test_field2', 'test_value2')
# => true

[redis.hget('test_key', 'test_field1'), redis.hget('test_key', 'test_field2')]
# => ["test_value1", "test_value2"]

redis.hdel('test_key', ['test_field1', 'test_field2'])
# => 0

[redis.hget('test_key', 'test_field1'), redis.hget('test_key', 'test_field2')]
# => ["test_value1", "test_value2"]
@sds sds added the bug label Jun 24, 2019
@sds
Copy link
Owner

sds commented Jun 24, 2019

Thanks for the report, @khiav223577!

Happy to merge a pull request with an accompanying test that fixes the behavior. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants