-
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1976 from corsonknowles/test_and_deprecate_top_le…
…vel_group_mixin_method Deprecate top_level_group? and test it in a Cop class
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe RuboCop::Cop::RSpec::TopLevelGroup do | ||
describe '#top_level_group?' do | ||
let(:stub_class) do | ||
Class.new do | ||
include RuboCop::Cop::RSpec::TopLevelGroup | ||
|
||
def initialize | ||
@top_level_groups = [] | ||
end | ||
|
||
def test_top_level_group | ||
top_level_group?(nil) | ||
end | ||
end | ||
end | ||
|
||
it 'warns because it is deprecated' do | ||
expect { stub_class.new.test_top_level_group }.to \ | ||
output(/warning: top_level_group\? is deprecated/).to_stderr | ||
end | ||
end | ||
end |