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