rubocop-rspec
rubocop-rspec copied to clipboard
Deprecate top_level_group? and test it in a Cop class
In this PR, we add a deprecation message for top_level_group?
, which has no callers in current Rubocop/RSpec
.
top_level_group?
was confirmed unused by @bquorning here:
- https://github.com/rubocop/rubocop-rspec/pull/1957#issuecomment-2370935206
- code change: https://github.com/rubocop/rubocop-rspec/pull/977/files#diff-538fd5bdf99dca6200224146c399b06a85bc9297598c1c4e71e0c9eaead8770bL15
We test this method using some stubbing in a Cop class that includes the mixin.
The specs can be removed along with the method in the next Major version update.
Split from:
- https://github.com/rubocop/rubocop-rspec/pull/1970
This PR serves the goal of completing line coverage for this repo and unblocks
- https://github.com/rubocop/rubocop-rspec/pull/1971
Before submitting the PR make sure the following are checked:
- [x] Feature branch is up-to-date with
master
(if not - rebase it). - [x] Squashed related commits together.
- [x] Added tests.
- [x] Updated documentation.
- [x] Added an entry to the
CHANGELOG.md
if the new code introduces user-observable changes. - [x] The build (
bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).
If you have created a new cop:
- [ ] Added the new cop to
config/default.yml
. - [ ] The cop is configured as
Enabled: pending
inconfig/default.yml
. - [ ] The cop is configured as
Enabled: true
in.rubocop.yml
. - [ ] The cop documents examples of good and bad code.
- [ ] The tests assert both that bad code is reported and that good code is not reported.
- [ ] Set
VersionAdded: "<<next>>"
indefault/config.yml
.
If you have modified an existing cop's configuration options:
- [ ] Set
VersionChanged: "<<next>>"
inconfig/default.yml
.