Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct subject description when using with passing a lambda #298

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

alex859
Copy link

@alex859 alex859 commented Oct 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected output using with on a map
3 participants