Skip to content

Add custom information to an assertion error message. #344

@evant

Description

@evant

This came up as a response to #12. It would be useful to add additional information to a failure to aid with tracking down the cause. Some bikeshed syntax (may change):

assertThat(success, context = { "DB state: " + repository.findUser(USER_ID) }).hasSize(1)

// expected [size]:<1> but was:<0>
//   DB state: User { name = "Tim" }"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions