Better assertion messages for your Kotlin tests
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
core
gradle/wrapper
hamcrest
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

ShouldKO

ShouldKO is tiny wrapper around assertion libraries to improve the error messages.

Build Status

Hamcrest

Given standard hamcrest assertions:

assertThat("abcde".startsWith("aa"), equalTo(true))

you'll get:

java.lang.AssertionError: 
Expected: <true>
     but: was <false>

However, ShouldKO improves on that:

"abcd".startsWith("aa").shouldEqual(true)

will result in:

java.lang.AssertionError: "abcd".startsWith("aa") 
Expected: <true>
     but: was <false>

Installation Download

Register bintray maven repository:

repositories {
    maven {
        url  "https://dl.bintray.com/brightinventions/maven" 
    }
}

And add 'pl.miensol.shouldko:hamcrest' to your test implementation dependencies:

compile 'pl.miensol.shouldko:hamcrest:x.y.z'