Repository navigation
Replies: 1 comment 3 replies
|
0 or 1: someMock.EXPECT().DoSomething().Return(nil).Maybe()Exactly 0: skip the expectation, then assert it stayed quiet. if checkMock {
someMock.EXPECT().DoSomething().Return(nil).Once()
} else {
defer someMock.AssertNotCalled(t, "DoSomething")
}If the mock is uber-go/mock, |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Preface, I'm not a fan of doing this, but I need to support others who are trying to have clean code.
Is there a way to cleanly get
someMock.EXEPCT().DoSomething().Times(value)where value can be 0 or 1? I don't seem to be able to get the 0 case to work.
All reactions