Skip to content

Instantly share code, notes, and snippets.

@crgarridos
Created October 9, 2018 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crgarridos/d2d168a96c36ff51d78d9958dd7d8b49 to your computer and use it in GitHub Desktop.
Save crgarridos/d2d168a96c36ff51d78d9958dd7d8b49 to your computer and use it in GitHub Desktop.
Able to mock a suspend function
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