commit | c4cb85e64ec5f27188a010c4a8626cfe20dae896 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Thu Nov 30 23:40:43 2017 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Thu Nov 30 23:40:43 2017 +0100 |
tree | 494c80714270a24733e208382a327828c90d1b2a | |
parent | 2565ed411aa4432c6a85585e5cfafdf9d5ef9260 [diff] |
Fix releasing to Maven Central
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on Maven Central and JCenter. For Gradle users, add the following to your build.gradle
, replacing x.x.x
with the latest version:
testCompile "com.nhaarman:mockito-kotlin:x.x.x"
A test using Mockito-Kotlin typically looks like the following:
@Test fun doAction_doesSomething(){ /* Given */ val mock = mock<MyClass> { on { getText() } doReturn "text" } val classUnderTest = ClassUnderTest(mock) /* When */ classUnderTest.doAction() /* Then */ verify(mock).doSomething(any()) }
For more info and samples, see the Wiki.