Skip to content

Commit 289f69c

Browse files
committed
Merge branch '2.x' into checketts-2.x
2 parents 5a303f6 + 76198ea commit 289f69c

File tree

14 files changed

+75
-24
lines changed

14 files changed

+75
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ out/
88

99
.idea/caches/*
1010
.idea/compiler.xml
11+
.idea/encodings.xml
1112
.idea/gradle.xml
1213
.idea/kotlinc.xml
1314
.idea/libraries/*

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ matrix:
1111
- jdk: oraclejdk8
1212
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.2.50
1313
- jdk: oraclejdk8
14-
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.3.0-rc-116
14+
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.3.0
1515
- jdk: oraclejdk8
1616
env: TERM=dumb KOTLIN_VERSION=1.0.7
1717
- jdk: oraclejdk8
1818
env: TERM=dumb KOTLIN_VERSION=1.1.61
1919
- jdk: oraclejdk8
2020
env: TERM=dumb KOTLIN_VERSION=1.2.50
2121
- jdk: oraclejdk8
22-
env: TERM=dumb KOTLIN_VERSION=1.3.0-rc-116
22+
env: TERM=dumb KOTLIN_VERSION=1.3.0
2323

2424

2525
env:

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ buildscript {
55
}
66
}
77
dependencies {
8-
classpath "io.spring.gradle:spring-bintray-plugin:0.9.0"
8+
classpath "io.spring.gradle:spring-bintray-plugin:0.11.1"
99
}
1010
}
1111

1212
plugins {
13-
id 'com.github.ben-manes.versions' version '0.17.0'
13+
id 'com.github.ben-manes.versions' version '0.20.0'
1414
}
1515

1616
apply from: 'gradle/scripts/tagging.gradle'

gradle/wrapper/gradle-wrapper.jar

523 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Dec 03 21:34:47 CET 2017
1+
#Mon Oct 29 21:53:52 CET 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

gradlew

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
3535

36-
warn ( ) {
36+
warn () {
3737
echo "$*"
3838
}
3939

40-
die ( ) {
40+
die () {
4141
echo
4242
echo "$*"
4343
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155155
fi
156156

157157
# Escape application args
158-
save ( ) {
158+
save () {
159159
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160160
echo " "
161161
}

mockito-kotlin/build.gradle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,39 @@ apply from: '../publishing.gradle'
33
apply plugin: 'org.jetbrains.dokka'
44

55
buildscript {
6-
ext.kotlin_version = "1.3.0-rc-146"
6+
ext.kotlin_version = "1.3.0"
77

88
repositories {
99
mavenCentral()
1010
jcenter()
11-
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
1211
}
1312

1413
dependencies {
1514
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16-
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.15"
17-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0"
18-
classpath "com.github.dcendents:android-maven-gradle-plugin:2.0"
15+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
16+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
17+
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
1918
}
2019
}
2120

2221
repositories {
2322
mavenCentral()
2423
jcenter()
25-
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
2624
}
2725

2826
dependencies {
2927
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
30-
compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.0-eap13'
28+
compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
3129

3230
compile "org.mockito:mockito-core:2.23.0"
3331

3432
testCompile 'junit:junit:4.12'
3533
testCompile 'com.nhaarman:expect.kt:1.0.0'
3634

3735
testCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
38-
testCompile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.0-eap13'
36+
testCompile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
3937

40-
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.30.0-eap13"
38+
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0"
4139
}
4240

4341
dokka {

mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/BDDMockito.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package com.nhaarman.mockitokotlin2
2727

2828
import org.mockito.BDDMockito
2929
import org.mockito.BDDMockito.BDDMyOngoingStubbing
30+
import org.mockito.stubbing.Answer
3031

3132
/**
3233
* Alias for [BDDMockito.given].
@@ -49,6 +50,13 @@ fun <T> then(mock: T): BDDMockito.Then<T> {
4950
return BDDMockito.then(mock)
5051
}
5152

53+
/**
54+
* Alias for [BDDMyOngoingStubbing.will]
55+
* */
56+
infix fun <T> BDDMyOngoingStubbing<T>.will(value: Answer<T>): BDDMockito.BDDMyOngoingStubbing<T> {
57+
return will(value)
58+
}
59+
5260
/**
5361
* Alias for [BBDMyOngoingStubbing.willAnswer], accepting a lambda.
5462
*/

mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Matchers.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fun <T : Any> notNull(): T? {
133133
* Object argument that is reflection-equal to the given value with support for excluding
134134
* selected fields from a class.
135135
*/
136-
fun <T> refEq(value: T, vararg excludeFields: String): T? {
137-
return Mockito.refEq(value, *excludeFields)
136+
inline fun <reified T : Any> refEq(value: T, vararg excludeFields: String): T {
137+
return Mockito.refEq<T>(value, *excludeFields) ?: createInstance()
138138
}
139139

mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Verification.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ fun <T> verifyBlocking(mock: T, f: suspend T.() -> Unit) {
5353
runBlocking { m.f() }
5454
}
5555

56+
/**
57+
* Verifies certain behavior happened at least once / exact number of times / never.
58+
*
59+
* Warning: Only one method call can be verified in the function.
60+
* Subsequent method calls are ignored!
61+
*/
62+
fun <T> verifyBlocking(mock: T, mode: VerificationMode, f: suspend T.() -> Unit) {
63+
val m = Mockito.verify(mock, mode)
64+
runBlocking { m.f() }
65+
}
5666
/**
5767
* Verifies certain behavior happened at least once / exact number of times / never.
5868
*

0 commit comments

Comments
 (0)