All Downloads are FREE. Search and download functionalities are using the official Maven repository.

run.smt.ktest.specs.BehaviorSpec.kt Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package run.smt.ktest.specs

import run.smt.ktest.api.BaseSpec
import run.smt.ktest.api.MetaInfoDSL
import run.smt.ktest.api.internal.SpecBuilder

abstract class BehaviorSpec(body: BehaviorSpec.() -> Unit = {}) : BaseSpec() {
    init {
        body()
    }

    fun  given(name: String, body: () -> T) = SpecBuilder.suite("Given: $name", body)
    fun  given(name: String, metaInfo: MetaInfoDSL, body: () -> T) = SpecBuilder.suite("Given: $name", metaInfo, body)
    fun  `when`(name: String, body: () -> T) = SpecBuilder.suite("When: $name", body)
    fun  `when`(name: String, metaInfo: MetaInfoDSL, body: () -> T) = SpecBuilder.suite("When: $name", metaInfo, body)
    fun  When(name: String, body: () -> T) = `when`(name, body)
    fun  When(name: String, metaInfo: MetaInfoDSL, body: () -> T) = `when`(name, metaInfo, body)
    fun then(name: String, body: () -> Unit) = SpecBuilder.case("Then: $name", body)
    fun then(name: String, metaInfo: MetaInfoDSL, body: () -> Unit) = SpecBuilder.case("Then: $name", metaInfo, body)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy