Created
October 9, 2018 13:42
-
-
Save crgarridos/d2d168a96c36ff51d78d9958dd7d8b49 to your computer and use it in GitHub Desktop.
Able to mock a suspend function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <T : Any, R> KStubbing<T>.onBlocking( | |
m: suspend T.() -> R | |
): OngoingStubbing<R> { | |
return runBlocking { Mockito.`when`(mock.m()) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment