Skip to content

Fix failure case for chained matchers #288

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

Merged
merged 5 commits into from
Jun 18, 2025
Merged

Fix failure case for chained matchers #288

merged 5 commits into from
Jun 18, 2025

Conversation

jas14
Copy link
Collaborator

@jas14 jas14 commented Jun 18, 2025

Fixes #286.

SuperDiff overrides the built-in RaiseError matcher to report that it is diffable? in most cases. RSpec accordingly assumes that it defines #expected. This issue may have existed since SuperDiff 0.2.0 and RSpec 3.2.0.

This PR monkey-patches the #expected assumption, much in the same way that we already do for #handle_failure.

Copy link

Copy link

@jas14 jas14 merged commit a85ecac into main Jun 18, 2025
60 checks passed
@jas14 jas14 deleted the 286-undefined-expected branch June 18, 2025 05:23
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.

undefined method 'expected' for an instance of RSpec::Matchers::BuiltIn::RaiseError when chaining and to raise_error
1 participant