captureNullable
Captures a nullable value to a CapturingSlot.
Uses io.mockk.slot to create capturing slot. Example:
interface FileNetwork {
fun download(name: String): File
}
val network = mockk<FileNetwork>()
val slot = slot<String?>()
every { network.download(captureNullable(slot)) } returns mockk()
network.download("testfile")
// slot.captured is now "testfile"Content copied to clipboard
Captures a nullable value to a MutableList.
Uses io.mockk.slot to create capturing slot.
See also
for non-nullable arguments.