mock
mock copied to clipboard
GoMock is a mocking framework for the Go programming language.
gomock caller.SetArg recognizes variadic pointer parameter as a single param ## Code example ```// Some Sample Function func (p *pkg) VariadicInterface(data ...interface{}) { for i := range data { data[i]...
## Requested feature Ability to disable the automatic call to `Controller.Finish`, such that the test does not fail if expected mocked calls are not made. ## Why the feature is...
It's not always obvious how `mockgen`-generated code has been created, particularly when coming to it without prior knowledge of it. Good practice would be to include a `go:generate` directive that...
I am encountering an issue mocking method calls with a functional argument. It appears that gomock is not matching the argument, and so failing with an unexpected call. Tests are...
### Description I think it would be nice to build an `ArgumentCaptor` interface and `argumentCaptor` struct that extends `Matcher` through composition, but store the value of the arguments before the...
If I derive a type from a core type and use that in my expectations, tests start failing where they didn't before, even where the inputs have not changed. I've...
*Requested feature* I am not sure if GoMock supports this natively or not. If it does, it would be nice if the documentation reflected how to do interaction testing more...
```go type IMQ interface { Publish(channel string, message interface{}) error Subscribe(channel string, message chan SetArg(1, ...) referring to argument of non-pointer non-interface non-slice type chan
Mockgen can't generate mocks for interfaces whose method param or return types are unnamed non-empty structs. For example: Suppose I have a `foo.go` file whose package import path is `foo`:...
# Requested Feature It would be nice to have a way to re-use a mock controller across multiple different tests. Currently, the docs for Controller have this to say on...