I've started using kotest:4.0.5 (kotlintest) and having problem with stringSpec
function nested in describe
clause.
Example:
class SellerTest : DescribeSpec({
describe("Registration") {
context("Not existing user") {
include(emailValidation()
}
}
})
fun emailValidation() = stringSpec {
"Email validation" {
forAll(
row("test.com"),
row("123123123123123")
) { email ->
assertSoftly {
val exception =
shouldThrow<ServiceException> { Email(email) }
}
}
}
}
If include(emailValidation())
is outside describe
clause then correctly works.
Have you any idea how to nest specs/functions in clauses?