Replies: 5 comments 2 replies
-
Would you, please, provide a short snippet showing this functionality? I'd like to see how convenient it can be before considering implementation details. |
Beta Was this translation helpful? Give feedback.
-
Quick example:
Tests:
I could test this code more efficiently with the Maybe() or Times(2). |
Beta Was this translation helpful? Give feedback.
-
For the Maybe(): that the query may be executed one or multiple times. |
Beta Was this translation helpful? Give feedback.
-
Would you, please, try v3 beta? Try this command to check it out: go get -u github.com/pashagolub/pgxmock/v3@v3.0.0-beta1 |
Beta Was this translation helpful? Give feedback.
-
I tested the new version and it works fine, thanks a lot :) |
Beta Was this translation helpful? Give feedback.
-
Currently, there's no way to set up a mock that can be used for multiple identical queries, similar to the Maybe() or Times() functionality in github.com/stretchr/testify/mock.
The objective is to allow the definition of a mock that can respond to the same query multiple times without needing to be redefined. This would be particularly useful for testing code that executes the same query in rapid succession.
Beta Was this translation helpful? Give feedback.
All reactions