Compatibility with Arrow • opensavvy.prepared.compat.arrow.coroutines • TestResourceScope
TestResourceScope¶
interface TestResourceScope : ResourceScope, TestDsl
A scope to combine Arrow's ResourceScope with Prepared's TestDsl.
This scope is used within tests that declare resources.
Resources declared in this scope are released at the end of the test.
Instances of this type can be obtained:
-
As a test fixture with
preparedResource -
Directly, with
resourceScope(useful for passing the test lifecycle to a component)
Additionally:
-
The
installfunctions allows binding a resource directly within a test. -
The
asPreparedfunction converts aResourceinto a Prepared value, Prepared's equivalent concept.
Properties¶
environment¶
abstract val environment: TestEnvironment
Functions¶
autoClose¶
bind¶
immediate¶
install¶
@IgnorableReturnValue
open fun <A : AutoCloseable> install(autoCloseable: A): A
install¶
Installs a Resource into the test's lifecycle scope.
invoke¶
onClose¶
onRelease¶
release¶
releaseCase¶
resourceScope¶
fun TestDsl.resourceScope(): TestResourceScope
Allows accessing the test lifecycle as an Arrow's ResourceScope.