Skip to content

Instantly share code, notes, and snippets.

@oleksiyp
Created November 2, 2018 18:45
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 oleksiyp/c9dbe87fab4b106a0567ef4c7dd2f8bb to your computer and use it in GitHub Desktop.
Save oleksiyp/c9dbe87fab4b106a0567ef4c7dd2f8bb to your computer and use it in GitHub Desktop.
"MockK: intentions" generic function
interface Cls {
fun <T>genericFn(): T
fun otherFn(param: Int) = param + 1
}
val mock = mockk<Cls>()
every {
mock.otherFn(mock.genericFn())
} returns 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment