tseisel
07/18/2019, 9:51 AMinfix fun <T> T.should(matcher: (T) -> Unit) ? What's its purpose ?
I use it like this :
person.should {
it.firstName shouldBe "John"
it.lastName shouldBe "Doe"
}
But that should seems redondant to me.wasyl
07/18/2019, 10:13 AMshouldBe checks for equality, should accepts a matcher. So you can write things like:
aNumber shouldBe lessThan 4wasyl
07/18/2019, 10:14 AMstr.shouldHaveLineCount(count) then you can write str should haveLineCount(count) as wellLeoColman
07/18/2019, 4:18 PMLeoColman
07/18/2019, 4:18 PM