mock
mock copied to clipboard
GoMock is a mocking framework for the Go programming language.
### Requested feature A function to make a reference of a call into a call variable: ```go func Ref(dest **gomock.Call, call *gomock.Call) *gomock.Call { *dest = call return call }...
The following changes InOrder to return the last called Call. This allows a more fluent design when using InOrder, things can be better chained together and allows composing of numerous...
*Requested feature* Document _why_ a user should choose the source or reflect mode. *Why the feature is needed* The README states: > mockgen has two modes of operation: source and...
I've been trying to use the gomock to perform some table driven testing. I need to be able to change the expected return values based on permutations of different errors...
# Current state The gomock framework causes a deadlock when a call is made on a mock from within a goroutine when using testing.T as the TestReporter. This is because...
@plakhotnii @codyoss `go list` is quite slow because it has to download external dependencies. This becomes more problematic under Bazel execution environment when GOCACHE is not available (https://github.com/bazelbuild/rules_go/issues/2366). I found...
We should update the docs to include best practices for how to handle advanced mocking scenarios like those mentioned in #352
https://github.com/golang/mock/blob/112dfb85f71efc679eef2a9763162fa83fbee449/gomock/call.go#L184 If someone uses Return with an interface slice, like `.Return(rets...)`, this line mutates the caller's slice. **How** it mutates it is semi-harmless, usually, but rather importantly this means tests...
There are a few features that would be best if they were opt in, whether this be for backwards compatibility or simply preference. An established pattern for configuring something beyond...