Skip to content

Conversation

kpavlov
Copy link

@kpavlov kpavlov commented Aug 16, 2025

Add fluent assertions DSL:

"Hello" shouldBe "Hello"
"Hello" shouldNotBe 1

withClue({ "Should be equal" }) {
    "Hello" shouldBe "Hello"
}

val err = assertFailsWith<AssertionError> {
    withClue("Should fail") {
        "Hello" shouldBe "Goodbye"
    }
}
assertEquals("Should fail. Expected <Goodbye>, actual <Hello>.", err.message)

val error = assertFailsWith<AssertionError> {
    withClue({ "Should fail" }) {
        "Hello" shouldBe "Goodbye"
    }
}
assertEquals("Should fail. Expected <Goodbye>, actual <Hello>.", error.message)

assertFailsWith<AssertionError>("shouldBe should fail when expected") {
    "Hello" shouldBe "Goodbye"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant