I will most likely switch to a shorter syntax either already in 0.8.0 or in 0.9.0 which will look as follows:
assert(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.