elliotchance / redismock

🕋 Mocking Redis in unit tests in Go.
MIT License
147 stars 24 forks source link

arguments not forwarded #10

Closed extrawurst closed 5 years ago

extrawurst commented 5 years ago

Great library @elliotchance !

I was wondering why arguments are not forwarded in cmdable.go?

I wanted to write expected calls to even match the arguments to make sure everything is forwared to redis correctly and then realized that all m.Called() lines do not forward the arguments. Is that intended?

elliotchance commented 5 years ago

This bug was previously raised in #9. Hopefully, @nmakro will get some time to work on it soon.

extrawurst commented 5 years ago

To be honest, I figured it's much easier to have the mock for redis be auto generated since I don't need the bridge to miniredis anyway and mockgen is doing exactly that: https://github.com/golang/mock

elliotchance commented 5 years ago

Ah yes, that works as well! :)

elliotchance commented 5 years ago

@Extrawurst, I had to think about it for a minute; why I created this library, and not just use another mocking framework. I use this when I want to have a persistent redis behind it, but dynamically control some behaviour during a particular test. Such as a timeout or connection difficulty.