Jim
10/12/2020, 10:24 PMEither
type, and I'd really like to do something like
val actual: <Unit, Errorish> = doThing()
withClue(lazy { "doThing error: ${actual.errorOrNull()?.message}" }) {
actual.isOk shouldBe true
}
Is this possible and I'm just not seeing a way in the current matchers? Basically I don't want to try to get the error message unless there's an error in my valueJim
10/12/2020, 10:27 PMsam
10/12/2020, 10:31 PMJim
10/12/2020, 10:34 PMsam
10/12/2020, 10:34 PMJim
10/12/2020, 10:34 PMJim
10/12/2020, 10:35 PMrequire
and assert
Jim
10/12/2020, 10:37 PMJim
10/12/2020, 10:37 PMsam
10/12/2020, 10:38 PMJim
10/12/2020, 10:46 PM(lazy { computeErrorMessage() }).asClue {
thing shouldBe true
}
like that?sam
10/12/2020, 10:47 PMJim
10/12/2020, 10:47 PMsam
10/12/2020, 11:05 PMJim
10/13/2020, 3:46 PMsam
10/13/2020, 4:02 PMsam
10/13/2020, 4:02 PMJim
10/13/2020, 4:10 PMJim
10/14/2020, 6:36 AM