Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants