spy

inline fun <T : Any> spy(): T
fun <T> spy(value: T): T

Creates a spy of the real object. The spy calls real methods unless they are stubbed.


inline fun <T : Any> spy(stubbing: KStubbing<T>.(T) -> Unit): T
inline fun <T : Any> spy(value: T, stubbing: KStubbing<T>.(T) -> Unit): T

Creates a spy of the real object, allowing for immediate stubbing. The spy calls real methods unless they are stubbed.