maybe this could be a nice addition to kotest for ...
# kotest
c
maybe this could be a nice addition to kotest for auto closing non AutoClosables:
Copy code
fun <T:Any> TestConfiguration.autoClose(wrapped: T, function: (T) -> Unit): T {
    autoClose(object :AutoCloseable{
        override fun close() {
            function(wrapped)
        }
    })
    return wrapped
}
👍 2