Spek documentation references
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() }
What exactly is memoized?
Aucun commentaire:
Enregistrer un commentaire