Skip to content

bright/shouldko

Repository files navigation

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:

testImplementation 'pl.miensol.shouldko:hamcrest:0.2.2'

About

Better assertion messages for your Kotlin tests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages