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

Show attribute details when composed have_attributes fails #1371

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nellirx
Copy link

@nellirx nellirx commented Apr 30, 2022

As requested in #759

For example
expect([person]).to match [have_attributes(:age => 10)]

Before
expected [#{object_inspect person}] to match [(have attributes {:age => 10})]

After
expected [#{object_inspect person}] to match [(have attributes {:age => 10} but had attributes {:age => 33})]

For example
expect([person]).to match [have_attributes(:age => 10)]

Before
expected [#{object_inspect person}] to match [(have attributes {:age => 10})]

After
expected [#{object_inspect person}] to match [(have attributes {:age => 10} but had attributes {:age => 33})]
Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right approach to take, formatted_valuesis returning the wrong value for failure_message for the array case, thats what we need to fix, not changing the description that breaks the contract of our public matcher api.

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.

2 participants