Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add .contains() support to expectThrows{} #297

@kenyee

Description

@kenyee

Sometimes you want to compare that the exception message is what you expect.

I currently use a combo of assertThrows like this:

val exception = assertThrows {}
expectThat(exception.message!!).contains("somestring")

because expectThrows doesn't let me check the message..

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