Skip to content

Commit

Permalink
Merge pull request #123 from nhaarman/release-0.12.1
Browse files Browse the repository at this point in the history
Release 0.12.1
  • Loading branch information
nhaarman committed Nov 15, 2016
2 parents ebc6147 + c974db0 commit 72279be
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ language: java
matrix:
include:
- jdk: oraclejdk7
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.0.5
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.0.5-2
- jdk: oraclejdk7
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.1-M02
- jdk: oraclejdk8
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.0.5
env: TERM=dumb KOTLIN_VERSION=1.0.5-2
- jdk: oraclejdk8
env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.1-M02
env: TERM=dumb KOTLIN_VERSION=1.1-M02


env:
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@
#

isRelease = false
publishToLocal = false
4 changes: 2 additions & 2 deletions mockito-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply from: './publishing.gradle'
apply plugin: 'org.jetbrains.dokka'

buildscript {
ext.kotlin_version = System.getenv("KOTLIN_VERSION") ?: '1.0.5'
ext.kotlin_version = System.getenv("KOTLIN_VERSION") ?: '1.0.5-2'

repositories {
mavenCentral()
Expand All @@ -26,7 +26,7 @@ repositories {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "org.mockito:mockito-core:2.2.15"
compile "org.mockito:mockito-core:2.2.17"

/* Tests */
testCompile "junit:junit:4.12"
Expand Down
2 changes: 0 additions & 2 deletions mockito-kotlin/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ uploadArchives {
)
}

if (publishToLocal) repository(url: mavenLocal().url)

pom.project {
name 'Mockito-Kotlin'
packaging 'jar'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fun doThrow(vararg toBeThrown: Throwable): Stubber = Mockito.doThrow(*toBeThrown
fun <T> eq(value: T): T = Mockito.eq(value) ?: value
fun ignoreStubs(vararg mocks: Any): Array<out Any> = Mockito.ignoreStubs(*mocks)!!
fun inOrder(vararg mocks: Any): InOrder = Mockito.inOrder(*mocks)!!
fun inOrder(vararg mocks: Any, evaluation: InOrder.() -> Unit) = Mockito.inOrder(*mocks).evaluation()

inline fun <reified T : Any> isA(): T? = Mockito.isA(T::class.java)
fun <T : Any> isNotNull(): T? = Mockito.isNotNull()
Expand Down
18 changes: 18 additions & 0 deletions mockito-kotlin/src/test/kotlin/test/MockitoTest.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package test

import com.nhaarman.expect.expect
import com.nhaarman.expect.expectErrorWithMessage
import com.nhaarman.expect.fail
Expand Down Expand Up @@ -177,6 +178,23 @@ class MockitoTest : TestBase() {
}
}

@Test
fun testInOrderWithLambda() {
/* Given */
val a = mock<() -> Unit>()
val b = mock<() -> Unit>()

/* When */
b()
a()

/* Then */
inOrder(a, b) {
verify(b).invoke()
verify(a).invoke()
}
}

@Test
fun testClearInvocations() {
val mock = mock<Methods>().apply {
Expand Down

0 comments on commit 72279be

Please sign in to comment.