withArg

inline fun <T : Any> withArg(noinline assertionErrorLogger: (AssertionError) -> Unit = { e -> e.printStackTrace() }, noinline captureBlock: MockKAssertScope.(T) -> Unit): T(source)

Captures argument and verifies it with provided block.

Return

the captured argument

Parameters

logAllAssertionErrors

if true, all assertion errors inside the captureBlock will be logged. This can cause multiple errors to be logged if the matcher is evaluated multiple times.

captureBlock

block that performs assertions on the captured argument.