I've added a couple helper functions for mockk.
fun verifyOnce(
ordering: Ordering = Ordering.UNORDERED,
inverse: Boolean = false,
timeout: Long = 0,
verifyBlock: MockKVerificationScope.() -> Unit,
) = verify(ordering = ordering, inverse = inverse, exactly = 1, timeout = timeout, verifyBlock = verifyBlock)
If I write it like that ^ then running w/ type resolution fails due to
ImplicitUnitReturnType
fun verifyOnce(
ordering: Ordering = Ordering.UNORDERED,
inverse: Boolean = false,
timeout: Long = 0,
verifyBlock: MockKVerificationScope.() -> Unit,
): Unit = verify(ordering = ordering, inverse = inverse, exactly = 1, timeout = timeout, verifyBlock = verifyBlock)
If I write it like that ^ then w/o type resolution it fails due to
OptionalUnit
What should I do in a situation like this? Just suppress one or the other? Which one?