mockgen/internal/tests/overlapping_methods/overlap_test.go
raw| 1 | // +build go1.14 |
| 2 | |
| 3 | package overlap |
| 4 | |
| 5 | import ( |
| 6 | "errors" |
| 7 | "testing" |
| 8 | |
| 9 | gomock "github.com/golang/mock/gomock" |
| 10 | ) |
| 11 | |
| 12 | // TestValidInterface assesses whether or not the generated mock is valid |
| 13 | func TestValidInterface(t *testing.T) { |
| 14 | ctrl := gomock.NewController(t) |
| 15 | defer ctrl.Finish() |
| 16 | |
| 17 | s := NewMockReadWriteCloser(ctrl) |
| 18 | s.EXPECT().Close().Return(errors.New("test")) |
| 19 | |
| 20 | s.Close() |
| 21 | } |