go-redis / redismock

Redis client Mock
https://redis.uptrace.dev
BSD 2-Clause "Simplified" License
280 stars 60 forks source link

Not able to mock setting json serialized data #35

Closed pramenn closed 2 years ago

pramenn commented 2 years ago

Hi,

I am running into issues mocking setting json serialized data for value, tried regex and that didn't work either, throws parameters do not match, expectation error with or without regex.

Here are a couple of examples of how I tried to mock setting json serialized data value: mock.Regexp().ExpectSet(key, "(.+)", 5*time.Minute).SetVal("hey") mock.Regexp().ExpectSet(key, "(\\[[\\d\\s]+\\])", 5*time.Minute).SetVal("hey")

Please let me know if I missed anything.