https://kotlinlang.org logo
Title
m

Mikhail Galanin

01/19/2021, 10:40 AM
Hello! Can anyone give me a clue why 
StringSpecScope
 doesn’t implement 
ContainerScope
? It appeared that I can’t use
io.kotest.core.datatest.forAll
inside
StringSpec
(or I haven’t found a way…)
s

sam

01/19/2021, 12:25 PM
Use 4.4 :)
m

Mikhail Galanin

01/19/2021, 1:22 PM
Indeed, it works with 4.4 RC2 :)
Although… Is it possible to have “sub-tests” in the results?
s

sam

01/19/2021, 1:57 PM
It should be doing that if you're using the newer data test stuff
which import are you using
m

Mikhail Galanin

01/19/2021, 2:04 PM
import io.kotest.core.datatest.forAll
import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe

class T002GeneratorTest : StringSpec({

    "Generate list of integer" {
        forAll(1, 2, 3) { value ->
            value shouldBe value + 0
        }
    }
})
s

sam

01/19/2021, 2:04 PM
Looks right
Actually this is broken, so don't use it
It's not registering the tests at all
m

Mikhail Galanin

01/19/2021, 2:23 PM
Thank you!
ookay, it looks like in RC3 nothing changed. So, I reckon the initial question is still the same…
s

sam

02/01/2021, 6:19 PM
so the issue is that you cannot nest tests with string spec
that's always been the case and I guess recently some regression came in that allowed it, but silently dropped it
in RC3 it's supposed to at least error when you do this
m

Mikhail Galanin

02/01/2021, 7:19 PM
so the issue is that you cannot nest tests with string spec
that was actually the question: why I cannot?
in RC3 it’s supposed to at least error when you do this
I’m probably doing something wrong but I don’t see the error 😞