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

support for client.Watch #5

Closed
bstpierre opened this issue Jan 3, 2021 · 0 comments
Closed

support for client.Watch #5

bstpierre opened this issue Jan 3, 2021 · 0 comments

Comments

@bstpierre
Copy link

Similar to issue #2, can we have support for Watch?

I have code like:

txf := func(tx *redis.Tx) error {
	val, err := tx.Get(ctx, "mykey").Int64()
	err = tx.Set(ctx, "mykey", val + 1, 0).Err()
}

err := client.Watch(ctx, txf, "mykey")

If my test code uses mock.ExpectGet("mykey") then I get:

parameters do not match, expectation '[get mykey]', but call to cmd '[watch mykey]'

I don't see anything in the code that will expect a WATCH. Is there a way to achieve this or does it need a patch?

Thank you.

bstpierre added a commit to bstpierre/redismock that referenced this issue Jan 3, 2021
This adds support for client.Watch().
monkey92t added a commit that referenced this issue Jan 5, 2021
Signed-off-by: monkey <monkey92t@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant