Spek 文档参考
As a best practice you typically want test values to be unique for each test this can be done by using a lateinit variable and assigning it within a beforeEachTest. lateinit var calculator: Calculator
beforeEachTest {
calculator = Calculator()
}
To make it more concise, Spek provides memoized to do the same thing:
val calculator by memoized { Calculator() }
究竟是什么?