henrik
06/27/2024, 9:54 AM"should drop default port" {
withData(
"<http://hei:80>" to "<http://hei>",
"<http://hei:88>" to "<http://hei:88>",
"<https://hei:443>" to "<https://hei>",
"<https://hei:448>" to "<https://hei:448>",
) { (input, expected) ->
input.toUrl().toString() shouldBe expected
input.toUri().toString() shouldBe expected
}
}
This gives me
Cannot add a root test after the spec has been instantiated: (<http://hei:80>, <http://hei>)
io.kotest.core.spec.InvalidDslException: Cannot add a root test after the spec has been instantiated: (<http://hei:80>, <http://hei>)
at io.kotest.core.spec.DslDrivenSpec.add(DslDrivenSpec.kt:46)
at io.kotest.core.spec.style.scopes.RootScopeKt.addTest(RootScope.kt:33)
at io.kotest.datatest.RootKt.withData(root.kt:65)
at io.kotest.datatest.RootKt.withData(root.kt:51)
at io.kotest.datatest.RootKt.withData(root.kt:16)
Any ideas what I'm doing wrong?henrik
06/27/2024, 10:10 AMKlitos Kyriacou
06/27/2024, 11:03 AMFreeSpec
at a container level (using -
):
class MySampleDataDrivenTest : FreeSpec({
"should drop default port" - {
withData(
"<http://hei:80>" to "<http://hei>",
"<http://hei:88>" to "<http://hei:88>",
"<https://hei:443>" to "<https://hei>",
"<https://hei:448>" to "<https://hei:448>",
) { (input, expected) ->
input.toUrl().toString() shouldBe expected
input.toUri().toString() shouldBe expected
}
}
})
henrik
06/27/2024, 11:09 AM-
!henrik
06/27/2024, 11:09 AMhenrik
06/27/2024, 11:09 AMhenrik
06/27/2024, 11:22 AMKlitos Kyriacou
06/27/2024, 11:36 AMhenrik
06/27/2024, 11:38 AM