File tree Expand file tree Collapse file tree 6 files changed +24
-8
lines changed
main/kotlin/com/nhaarman/mockito_kotlin Expand file tree Collapse file tree 6 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ language: java
55matrix :
66 include :
77 - jdk : oraclejdk7
8- env : TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.0.5
8+ env : TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.0.5-2
99 - jdk : oraclejdk7
1010 env : TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.1-M02
1111 - jdk : oraclejdk8
12- env : TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.0.5
12+ env : TERM=dumb KOTLIN_VERSION=1.0.5-2
1313 - jdk : oraclejdk8
14- env : TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.1-M02
14+ env : TERM=dumb KOTLIN_VERSION=1.1-M02
1515
1616
1717env :
Original file line number Diff line number Diff line change 2424#
2525
2626isRelease = false
27- publishToLocal = false
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ apply from: './publishing.gradle'
33apply plugin : ' org.jetbrains.dokka'
44
55buildscript {
6- ext. kotlin_version = System . getenv(" KOTLIN_VERSION" ) ?: ' 1.0.5'
6+ ext. kotlin_version = System . getenv(" KOTLIN_VERSION" ) ?: ' 1.0.5-2 '
77
88 repositories {
99 mavenCentral()
@@ -26,7 +26,7 @@ repositories {
2626dependencies {
2727 compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
2828 compile " org.jetbrains.kotlin:kotlin-reflect:$kotlin_version "
29- compile " org.mockito:mockito-core:2.2.15 "
29+ compile " org.mockito:mockito-core:2.2.17 "
3030
3131 /* Tests */
3232 testCompile " junit:junit:4.12"
Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ uploadArchives {
4040 )
4141 }
4242
43- if (publishToLocal) repository(url : mavenLocal(). url)
44-
4543 pom. project {
4644 name ' Mockito-Kotlin'
4745 packaging ' jar'
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ fun doThrow(vararg toBeThrown: Throwable): Stubber = Mockito.doThrow(*toBeThrown
7676fun <T > eq (value : T ): T = Mockito .eq(value) ? : value
7777fun ignoreStubs (vararg mocks : Any ): Array <out Any > = Mockito .ignoreStubs(* mocks)!!
7878fun inOrder (vararg mocks : Any ): InOrder = Mockito .inOrder(* mocks)!!
79+ fun inOrder (vararg mocks : Any , evaluation : InOrder .() -> Unit ) = Mockito .inOrder(* mocks).evaluation()
7980
8081inline fun <reified T : Any > isA (): T ? = Mockito .isA(T ::class .java)
8182fun <T : Any > isNotNull (): T ? = Mockito .isNotNull()
Original file line number Diff line number Diff line change 11package test
2+
23import com.nhaarman.expect.expect
34import com.nhaarman.expect.expectErrorWithMessage
45import com.nhaarman.expect.fail
@@ -177,6 +178,23 @@ class MockitoTest : TestBase() {
177178 }
178179 }
179180
181+ @Test
182+ fun testInOrderWithLambda () {
183+ /* Given */
184+ val a = mock< () -> Unit > ()
185+ val b = mock< () -> Unit > ()
186+
187+ /* When */
188+ b()
189+ a()
190+
191+ /* Then */
192+ inOrder(a, b) {
193+ verify(b).invoke()
194+ verify(a).invoke()
195+ }
196+ }
197+
180198 @Test
181199 fun testClearInvocations () {
182200 val mock = mock<Methods >().apply {
You can’t perform that action at this time.
0 commit comments