go-redis / redismock

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

How to test with redismock function "ScanType" #22

Open googsvg opened 2 years ago

googsvg commented 2 years ago

Hello,

I'm using your redismock and it works great! :)

I am using your scan for type, ScanType, but I am missing the ExpectedScanType. Using ExpectedScan isn't working, since the error that pops out is: expectation '[scan 0 match test_login:d3812faf80134ee6ec6b6cbd]', but call to cmd '[scan 0 match test_login:* type hash]'

Can you please provide me with what I should use for testing ScanType? Thanks!

james-coopstools commented 2 years ago

I added PR for this feature: https://github.com/go-redis/redismock/pull/31

Until the PR is approved or a different change is in place, my fork is off of 8.0.6, and the only change is adding this feature (and corresponding test). go get github.com/james-coopstools/redismock/v8@v8.0.6c

(P.S. This is my first time attempting to contribute to an open source project; please let me know if I am doing anything wrong)