hastebrot
07/05/2016, 1:17 PMStringSpec
to following code. Haven't found a better way to allow StringSpec
with init()
and with constructor body.
abstract class StringSpec(body: StringSpec.() -> Unit = {}) : TestBase() {
init { body(this) }
operator fun String.invoke(test: () -> Unit): TestCase {
val tc = TestCase(suite = root, name = this, test = test, config = defaultTestCaseConfig)
root.cases.add(tc)
return tc
}
}