1

When I do this:

class KotlinTestNestingWithAndTests8 : BehaviorSpec() {

    override fun isolationMode() = IsolationMode.InstancePerLeaf

    init {
        given(" Some given") {
            and("Some and") {
                `when`("Some when") {
                    then("First then") {
                        (1).shouldBe(1)
                    }
                    then("Second then") {
                        (2).shouldBe(2)
                    }
                    then("Third then") {
                        (3).shouldBe(3)
                    }
                }
            }
        }
    }
}

IntelliJ shows this:

enter image description here

Why are the last two leaf tests not nested as siblings of the first leaf test?

Am I not understanding the use case for the InstancePerLeaf setting and tests are not supposed to be nested in this way when using it?

UPDATE: I created a bug ticket.

Julian A.
  • 10,928
  • 16
  • 67
  • 107

0 Answers0