![JAR search and dependency download from the Maven repository](/logo.png)
io.justdevit.kotlin.boost.kotest.mockk.Spec.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boost-kotest-mockk Show documentation
Show all versions of boost-kotest-mockk Show documentation
Library to boost working with Kotlin/JVM projects.
The newest version!
package io.justdevit.kotlin.boost.kotest.mockk
import io.kotest.core.spec.Spec
import io.mockk.clearAllMocks
/**
* Applies clearing of all mocks for the current spec.
*
* Usage:
* ```
* class MyTest : FreeSpec({
*
* installMockkClearing()
*
* ...
* })
* ```
*/
fun Spec.installMockkClearing(
answers: Boolean = true,
recordedCalls: Boolean = true,
childMocks: Boolean = true,
regularMocks: Boolean = true,
objectMocks: Boolean = true,
staticMocks: Boolean = true,
constructorMocks: Boolean = true,
) {
beforeEach {
clearAllMocks(
answers = answers,
recordedCalls = recordedCalls,
childMocks = childMocks,
regularMocks = regularMocks,
objectMocks = objectMocks,
staticMocks = staticMocks,
constructorMocks = constructorMocks,
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy