Skip to content

Feature Request: Add description to matchesPredicate assertion #514

@jdsee

Description

@jdsee

Hi 👋

It would be great if the matchesPredicate assertion would allow a description parameter to be displayed on an assertion error instead of satisfy the predicate.

It could look something like this:

assertThat(x).matchesPredicate("some very special requirements") { it.isSpecial() }

which would then result in the error message:

expected X(special=false) to satisfy some very special requirements

I'm happy to submit a PR for this as soon as I find time for it.

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