From b45275996b84c4711537b62852e87b4ea56afdfc Mon Sep 17 00:00:00 2001 From: Pablo Gonzalez Alonso Date: Mon, 11 Nov 2019 16:17:11 +0000 Subject: [PATCH] Add infix to stubbing --- .../src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt b/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt index 48442400..e1fdddc1 100644 --- a/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt +++ b/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt @@ -39,7 +39,7 @@ inline fun stubbing( KStubbing(mock).stubbing(mock) } -inline fun T.stub(stubbing: KStubbing.(T) -> Unit): T { +inline infix fun T.stub(stubbing: KStubbing.(T) -> Unit): T { return apply { KStubbing(this).stubbing(this) } } @@ -81,4 +81,4 @@ class KStubbing(val mock: T) { ): OngoingStubbing { return runBlocking { Mockito.`when`(mock.m()) } } -} \ No newline at end of file +}