fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit): Expect<T> (source)
Allows to state a reason for one or multiple assertions for the current subject.
expect("filename")
.because("? is not allowed in file names on Windows") {
containsNot("?")
}
expect(customers).all {
because("the legal age of maturity in Switzerland is 18") {
feature { f(it::age) }.isGreaterThanOrEqual(18)
}
}
reason - The explanation for the assertion(s) created by assertionCreator.
assertionCreator - The group of assertions to make.
Return
an Expect for the subject of this expectation.
Since
0.15.0