mock.Mock is not mock.assertExpectationser: missing method AssertExpectations
Upgrading from v1.7.1 to v1.8.0 results in this for my tests which call AssertExpectationsForObjects:
mock.Mock is not mock.assertExpectationser: missing method AssertExpectations
Called like this:
mock.AssertExpectationsForObjects(t, someRepository.Mock, otherRepository.Mock)
Where someRespository and otherRepository are generated via mockery and defined like such:
type someRepository struct {
mock.Mock
}
Looking at v1.8.0, I can see the assertExpectationser interface is defined here, and implemented by mock.Mock here.
I see that passing in myMock.Mock is deprecated, and we should pass in myMock instead, but this still results in the same error, just kicks the can up the stack. Eitherway, while deprecated, it'll still work due to this line.
For me passing in myMock rather than myMock.Mock does fix this, maybe you missed one?
However, you have found a valid bug, this change caused this regression in its attempt to fix a go vet finding. The only way to fix this vet would be a breaking change in the API of AssertExpectationsForObjects.
I would like to see a reproducible test case running on https://go.dev/play .