abstract class TestFactoryConfiguration : TestConfiguration
A TestFactoryConfiguration provides a DSL to allow for easy creation of a TestFactory when this class is the receiver of a lambda parameter.
This class shouldn't be used directly, but as the base for a particular layout style, eg FunSpecTestFactoryConfiguration.
<init> |
A TestFactoryConfiguration provides a DSL to allow for easy creation of a TestFactory when this class is the receiver of a lambda parameter. TestFactoryConfiguration() |
addDynamicTest |
Adds a new DynamicTest to this factory. When this factory is included into a Spec these tests will be added to the spec as root TestCases. fun addDynamicTest(name: String, test: suspend TestContext.() -> Unit, config: TestCaseConfig, type: TestType): Unit |
afterTest |
Registers a new after-test callback to be executed after every TestCase. The callback provides two parameters - the test case that has just completed, and the TestResult outcome of that test. open fun afterTest(f: AfterTest): Unit |
beforeTest |
Registers a new before-test callback to be executed before every TestCase. The TestCase about to be executed is provided as the parameter. open fun beforeTest(f: BeforeTest): Unit |
autoClose |
Closes an AutoCloseable when the spec is completed by registering an afterSpec listener which invokes the AutoCloseable.close method. fun <T : AutoCloseable> TestConfiguration.autoClose(closeable: T): T
Closes a lazy AutoCloseable when the spec is completed by registering an afterSpec listener which invokes the AutoCloseable.close method. fun <T : AutoCloseable> TestConfiguration.autoClose(closeable: Lazy<T>): Lazy<T> |
build |
Builds an immutable TestFactory from this configuration. fun TestFactoryConfiguration.build(): TestFactory |
tempfile |
fun TestConfiguration.tempfile(prefix: String? = null, suffix: String? = ".tmp"): File |