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
5
5
matrix :
6
6
include :
7
7
- 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
9
9
- jdk : oraclejdk7
10
10
env : TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.1-M02
11
11
- 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
13
13
- 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
15
15
16
16
17
17
env :
Original file line number Diff line number Diff line change 24
24
#
25
25
26
26
isRelease = false
27
- publishToLocal = false
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ apply from: './publishing.gradle'
3
3
apply plugin : ' org.jetbrains.dokka'
4
4
5
5
buildscript {
6
- ext. kotlin_version = System . getenv(" KOTLIN_VERSION" ) ?: ' 1.0.5'
6
+ ext. kotlin_version = System . getenv(" KOTLIN_VERSION" ) ?: ' 1.0.5-2 '
7
7
8
8
repositories {
9
9
mavenCentral()
@@ -26,7 +26,7 @@ repositories {
26
26
dependencies {
27
27
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
28
28
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 "
30
30
31
31
/* Tests */
32
32
testCompile " junit:junit:4.12"
Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ uploadArchives {
40
40
)
41
41
}
42
42
43
- if (publishToLocal) repository(url : mavenLocal(). url)
44
-
45
43
pom. project {
46
44
name ' Mockito-Kotlin'
47
45
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
76
76
fun <T > eq (value : T ): T = Mockito .eq(value) ? : value
77
77
fun ignoreStubs (vararg mocks : Any ): Array <out Any > = Mockito .ignoreStubs(* mocks)!!
78
78
fun inOrder (vararg mocks : Any ): InOrder = Mockito .inOrder(* mocks)!!
79
+ fun inOrder (vararg mocks : Any , evaluation : InOrder .() -> Unit ) = Mockito .inOrder(* mocks).evaluation()
79
80
80
81
inline fun <reified T : Any > isA (): T ? = Mockito .isA(T ::class .java)
81
82
fun <T : Any > isNotNull (): T ? = Mockito .isNotNull()
Original file line number Diff line number Diff line change 1
1
package test
2
+
2
3
import com.nhaarman.expect.expect
3
4
import com.nhaarman.expect.expectErrorWithMessage
4
5
import com.nhaarman.expect.fail
@@ -177,6 +178,23 @@ class MockitoTest : TestBase() {
177
178
}
178
179
}
179
180
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
+
180
198
@Test
181
199
fun testClearInvocations () {
182
200
val mock = mock<Methods >().apply {
You can’t perform that action at this time.
0 commit comments