commit | 7fb4bd9ff100f88d5d621d5726b374b55c30468f | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Thu Nov 24 11:22:46 2016 +0100 |
committer | GitHub <noreply@github.com> | Thu Nov 24 11:22:46 2016 +0100 |
tree | 1566e6aabde4367b5524885dbd94dc737b4a35ce | |
parent | 72279beeb542c40c8f8f5d861fe0e45a96316094 [diff] | |
parent | 05a65ecc2977009d5920c2adb58f69f853df4b0d [diff] |
Merge pull request #127 from nhaarman/release-0.12.2 Release 0.12.2
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on Maven Central. For Gradle users, add the following to your build.gradle
, replacing x.x.x
with the latest version:
repositories { mavenCentral() } dependencies { testCompile "com.nhaarman:mockito-kotlin:x.x.x" }
A test using Mockito-Kotlin typically looks like the following:
@Test fun a(){ /* 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.