https://kotlinlang.org logo
Title
s

sam

02/06/2021, 7:08 PM
Would appreciate any feedback on https://github.com/kotest/kotest/issues/2065
w

wasyl

02/06/2021, 8:01 PM
I personally dislike 2., mostly because it’d introduce overhead when configuring just one test
How about two variants:
.config(timeout = …, enabled = …)
and also
.config(config: TestConfigBuilder.() -> Unit
so that the first one can delegate to the second one
And then you can share configs by doing
val config: TestConfigBuilder.() -> Unit = configBuilder { … }
I guess I’m mostly advocating for the current postfix function-style. But be aware I don’t use configs often so I might biased. The last version rubs me the wrong way somehow. Something about adding a global method that’s not spec-specific.
s

sam

02/06/2021, 8:45 PM
I think your idea of having the original version delegate to the builder version could work well.