Thanks <@U12AGS8JG> and <@UB9K6R4JH> A couple of f...
# kotest
c
Thanks @sam and @LeoColman A couple of follow up questions: 1: If i add a
Copy code
afterTest {
        println("afterTest called for '${it.a.name}'")
    }
..i get
Copy code
beforeTest called for 'when container when' of type: Container
afterTest called for 'when container when'
beforeTest called for 'should container should' of type: Container

beforeTest called for 'the tests' of type: Test
testing
afterTest called for 'the tests'

afterTest called for 'should container should'
So it seems like the
When
is completed before (or independently of) its children while the
should
is completing its children before completing itself. Is this an explicit approach or should I just not make to many assumptions regarding the ordering of completions? 2: Do you have a recommended approach for doing setup/teardown scoped on
When
for resources that are to be available for all the Whens children? Not for every
When
in the spec but for a single instance. I'm moving over from Spek 1 where this could be achieved with `beforeGroup`/`afterGroup`. The only approach I have found so far is to factor these cases out into separate specs. Leaf isolation mode would not be optimal since it would recreate the resource for each TEST not for each When. I suspect I need to adjust my expectation as to the contract Kotest offers reg. the relationship between nested containers/tests.
s
It sounds to be like a bug.
It should always be beforeOuter, beforeInner, afterInner, afterOuter
every inner scope should fire and complete before the afterMethods on the outer