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

Provide fake connection for testing? #455

Closed
mlh758 opened this issue Feb 18, 2021 · 3 comments
Closed

Provide fake connection for testing? #455

mlh758 opened this issue Feb 18, 2021 · 3 comments

Comments

@mlh758
Copy link

mlh758 commented Feb 18, 2021

I wrote a basic in-memory fake for the AsyncCommands trait. It's been a nice way to pass this to my functions and make sure they're collecting the correct types and such.

Here is the implementation. Is this something that you would be interested in having as part of the redis-rs library itself? I understand not wanting to take on maintenance for it, but I think it could be helpful for other people writing tests so I thought I'd ask.

@tdyas
Copy link
Contributor

tdyas commented Mar 16, 2021

I wrote something similar as well although focused on ConnectionLike. PR here: #465

@mlh758
Copy link
Author

mlh758 commented Mar 17, 2021

My implementation is for ConnectionLike, that's definitely the easiest way to get Commands. On your PR, this is how you can test a pipeline with a mock ConnectionLike implementation.

@mlh758
Copy link
Author

mlh758 commented Mar 17, 2021

Going to close this though, it hasn't gotten any comments from maintainers and your PR is sitting open too.

@mlh758 mlh758 closed this as completed Mar 17, 2021
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

2 participants