Skip to content

Commit

Permalink
Merge branch 'matejdro-2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaarman committed May 10, 2018
2 parents f6e4390 + d247f07 commit fe1ddec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fun inOrder(vararg mocks: Any): InOrder {
*
* Alias for [Mockito.inOrder].
*/
fun inOrder(
inline fun inOrder(
vararg mocks: Any,
evaluation: InOrder.() -> Unit
) {
Expand Down
16 changes: 12 additions & 4 deletions mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
package test

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.verifyBlocking
import com.nhaarman.mockitokotlin2.*
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.runBlocking
Expand Down Expand Up @@ -139,6 +136,17 @@ class CoroutinesTest {

verifyBlocking(m) { suspending() }
}

@Test
fun verifySuspendMethod() = runBlocking {
val testSubject : SomeInterface = mock()

testSubject.suspending()

inOrder(testSubject) {
verify(testSubject).suspending()
}
}
}

interface SomeInterface {
Expand Down

0 comments on commit fe1ddec

Please sign in to comment.