Skip to content

Support several expect/assert cycles for same mock #1

@tcard

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.

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