Skip to content

mock.Mock is not mock.assertExpectationser: missing method AssertExpectations #1227

@mohammad-koho

Description

@mohammad-koho

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions