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

SuperDiff doesn't respect extra_failure_lines metadata of RSpec #108

Closed
y-yagi opened this issue Dec 2, 2020 · 5 comments
Closed

SuperDiff doesn't respect extra_failure_lines metadata of RSpec #108

y-yagi opened this issue Dec 2, 2020 · 5 comments
Labels

Comments

@y-yagi
Copy link
Contributor

y-yagi commented Dec 2, 2020

RSpec holds additional information in extra_failure_lines metadata and it uses when showing failure lines.
https://github.com/rspec/rspec-core/blob/fe3084758857f0714f05ada44a18f1dfe9bf7a7e/lib/rspec/core/formatters/exception_presenter.rb#L161

For example, system examples set failures screenshot paths in the metadata.
https://github.com/rspec/rspec-rails/blob/9217638aff96df56753eeafe60e16bc4c35b8566/lib/rspec/rails/example/system_example_group.rb#L118

But it seems that SuperDiff doesn't the metadata when showing tests result. Is it expected behavior?

@mcmire
Copy link
Collaborator

mcmire commented Dec 2, 2020

Thanks for bringing this up. It's very possible I forgot to include this or chose not to include this in order to get something out faster. Either way, this is definitely not expected.

@janko
Copy link

janko commented Jul 27, 2021

Would be great to find a solution for this, as the missing capybara screenshots is currently preventing us from using super_diff 🙏🏻

@mcmire mcmire self-assigned this Jul 27, 2021
@mcmire mcmire removed their assignment Feb 11, 2023
@templeman15
Copy link

Also can't use it do to this! Do you happen to know where the change needs to occur, I could maybe get a PR up for it?

@mcmire
Copy link
Collaborator

mcmire commented Mar 28, 2023

@templeman15 Yup! So this gem patches the code in RSpec that's responsible for printing errors, as it has its own way of coloring the output. You can compare the two by looking at https://github.com/rspec/rspec-core/blob/a665896882ec941c4f3a19200fb23327dfd2ebff/lib/rspec/core/formatters/exception_presenter.rb and https://github.com/mcmire/super_diff/blob/afc80ab3d71a58a07ac4c6d71fe95582cac4b781/lib/super_diff/rspec/monkey_patches.rb (scroll down to ExceptionPresenter). It's a bit complicated, but the main difference is that whereas colorized_message_lines in RSpec's version calls failure_lines to gather the lines, which includes extra_failure_lines, colorized_message_lines in SuperDiff's version calls failure_line_groups, which does not.

@mcmire
Copy link
Collaborator

mcmire commented Jan 22, 2024

I apologize for the delay in addressing this bug. Thanks for the report — I've fixed this in #208. I'll post back when this is available in a release.

@mcmire mcmire closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants