Skip to content

Support several expect/assert cycles for same mock #1

Description

@tcard

You should be able to do something like this:

mock := &SomeInterfaceMock{...}
subject := NewRealCode(mock)

assertMock := mock.Describe().(...)
subject.DoSomethingUsingMock()
assertMock(t)

assertMock = mock.Describe().(...)
subject.DoAnotherThingUsingMock()
assertMock(t)

Right now Describe() is a method on a mocker, which is a builder for mock objects, and ultimately produces the mock object alongside the assertMock function. It should act on an already existing mock object instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions