strikt
strikt copied to clipboard
Use correct subject description when using with passing a lambda
When creating a nested assertion using with
passing a lambda, the property description is incorrect:
val subject = Person("David", LocalDate.of(1947, 1, 8))
expectThat(subject) {
with({ birthDate }) {
get { year }.isEqualTo(1971)
}
}
produces:
▼ Expect that Person(name=David, birthDate=1947-01-08):
▼ year:
▼ year:
✗ is equal to 1971
found 1947
but it should be:
▼ Expect that Person(name=David, birthDate=1947-01-08):
▼ birthDate:
▼ year:
✗ is equal to 1971
found 1947
The same should be happening when passing a CallableReference
to with
, but I don't know how to reproduce the issue.
fixes #252