Fixture

A fixture is a state holder for a lazily initialized Value with a lifetime of the test suite registering it.

If Value is an AutoCloseable, the fixture will call close at the end of its lifetime, otherwise closeWith can register a specific action to be called on close.

Functions

Link copied to clipboard
infix fun closeWith(action: suspend Value.() -> Unit): TestSuite.Fixture<Value>

Registers action to be called when this fixture's lifetime ends.

Link copied to clipboard
suspend operator fun invoke(): Value

Returns the fixture's value, instantiating it on first use.