Chris Lee
01/16/2024, 1:56 AMwithContext
method:
test("Arrow context-receiver / Raise sample test") {
withContext {
something.raiseContextRequiredMethod(args).shouldBe(true)
something.anotherRaiseContextRequiredMethod(args).shouldBe(false)
}
}
public inline fun <Error> TestScope.withContext(
@BuilderInference block: Raise<Error>.() -> Unit
): Unit = recover(block) { fail("Expected to succeed, but raised $it") }
Are there better approaches?