keturn
10/10/2018, 3:13 AMproperty(subject::x).toBe(...)
is a lot of extra words.dave08
10/10/2018, 7:00 AMrobstoll
10/12/2018, 11:05 AMassert(Person("robert")) {
name == "robert"
}
Instead of
assert(Person("robert")){
property(subject::name).toBe("robert")
}
Right?robstoll
10/12/2018, 11:33 AMassert(Person("robert")) {
property { ::name }.toBe("robert")
}
And of course, you could add an alias for property, say p
which makes it look like:
assert(Person("robert")) {
p { ::name }.toBe("robert")
}
Or on one line
assert(Person("robert")).p { ::name }.toBe("robert")
And in case you prefer infix style:
assert(Person("robert")) p { ::name } toBe "robert"
Which comes close to the syntax of PowerAssert. If we could overload ==
in Kotlin I could provide something which resembles it even more.keturn
10/12/2018, 3:27 PM