Closed iwaseasahi closed 1 week ago
There is a difference in behavior between MockRedis#hset and Redis#hset when passing a flattened array.
MockRedis#hset
Redis#hset
require 'redis' redis = Redis.new hash = {:name=>"job", :namespace=>"default", :klass=>"Job"} redis.hset("key", hash.flatten) redis.hgetall("key") => {"name"=>"job", "namespace"=>"default", "klass"=>"Job"}
require 'mock_redis' mock_redis = MockRedis.new hash = {:name=>"job", :namespace=>"default", :klass=>"Job"} mock_redis.hset("key", hash.flatten) mock_redis.hgetall("key") => {"[:name, \"job\", :namespace, \"default\", :klass, \"Job\"]"=>""}
Opened https://github.com/sds/mock_redis/pull/312 to resolve this issue.
@jvanderen1 Thank you very much!
Versions
Description
There is a difference in behavior between
MockRedis#hset
andRedis#hset
when passing a flattened array.With Redis:
With MockRedis: