Skip to content

Add support for BDD style expectations #350

Description

@Nokel81

Proposal

Add support for blocking on consuming expectations until an expectation has been declared. Internally it would use a channel instead of an array of expectations. It would also imply MatchExpectationsInOrder.

var mock sqlmock.Sqlmock

...

mock.BlockExpectationsUntilExpected(true)

Use-cases

This is for BDD style testing where most of the configurations of expectations are done sequentially in BeforeEach's (such as from "github.com/onsi/ginkgo/v2") and then the individual tests are each very small with a single Expect call

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions