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

Drop dead (private) methods from BaseMatcher #1457

Merged
merged 2 commits into from
May 9, 2024

Conversation

nevinera
Copy link
Contributor

@nevinera nevinera commented May 8, 2024

Drop the assert_ivars and present_ivars methods from RSpec::Matchers::BuiltIn::BaseMatcher`.

They aren't referenced anymore, and apparently haven't been for ~10 years. I confirmed with git pickaxes, but then I also checked out a few random points in time over that period and looked for either string in the repository - no references in 2015, or at any point I looked since then.

It is possible that (against your strong recommendations), people are subclassing this class for their custom matchers, but I think that's their problem. And this isn't a particularly obvious or natural method for them to be using anyway.

They aren't referenced anymore, and apparently haven't been for ~10
years.
@nevinera nevinera marked this pull request as ready for review May 8, 2024 20:35
@nevinera nevinera mentioned this pull request May 8, 2024
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thank you!
100% coverage already yields results

lib/rspec/matchers/built_in/base_matcher.rb Outdated Show resolved Hide resolved
@pirj pirj merged commit 94f00e3 into rspec:main May 9, 2024
29 of 30 checks passed
@nevinera nevinera deleted the nev--remove-dead-base-matcher-code branch May 9, 2024 13:40
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.

None yet

3 participants