https://kotlinlang.org logo
#kotest
Title
# kotest
i

Ihar S

12/10/2023, 7:35 PM
Hello magicians Most likely my question is naive But anyway, kotlin behaviorspec, is it a way to avoid pyramid of death?
Copy code
Given("A") {
    And("B") {
        And("C") {
            And("D") {
                When("E"){
                    And("F"){
                        And("G"){

                         }
                    }
                }
           }
        }
    }
}
l

LeoColman

12/10/2023, 7:39 PM
You can reduce indentation so it doesn't look so ugly
You can also try to avoid chaining
And
And always, you can switch to another spec 😛
s

sam

12/10/2023, 9:52 PM
You can put And's on the same level but it won't nest them in output. Probably don't need too many levels of indentation for a readable test.
2
🐕 1
i

Ihar S

12/10/2023, 10:54 PM
Thank you for suggestions 🫂 I was sure kotest has more possible ways to deal with such situations