what do you think about the following solution to ...
# spek
k
what do you think about the following solution to the double initialization problem:
Copy code
fun <T : Any> DescribeBody.subject(block: () -> T) = Resettable(block).apply {
    beforeEach { reset() }
}

class Resettable<out T : Any>(private val init: () -> T) {
    private lateinit var value: T

    fun reset() {
        value = init()
    }

    operator fun invoke() = value
}