Skip to content

Commit 03034e7

Browse files
authored
Merge pull request #1936 from koic/suppress_deprecation_warning_when_some_cops
Suppress deprecation warning for some cops
2 parents aa734b0 + 7e1d68e commit 03034e7

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Master (Unreleased)
44

55
- Add support for Unicode RIGHT SINGLE QUOTATION MARK in `RSpec/ExampleWording`. ([@jdufresne])
6+
- Suppress deprecation warning for `RSpec/MultipleExpectations`, `RSpec/MultipleMemoizedHelpers`, and `RSpec/NestedGroups` cops. ([@koic])
67

78
## 3.0.2 (2024-07-02)
89

lib/rubocop/cop/rspec/multiple_expectations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ module RSpec
6767
# end
6868
#
6969
class MultipleExpectations < Base
70-
include ConfigurableMax
71-
7270
MSG = 'Example has too many expectations [%<total>d/%<max>d].'
7371

7472
ANYTHING = ->(_node) { true }
7573
TRUE_NODE = lambda(&:true_type?)
7674

75+
exclude_limit 'Max'
76+
7777
# @!method aggregate_failures?(node)
7878
def_node_matcher :aggregate_failures?, <<~PATTERN
7979
(block {

lib/rubocop/cop/rspec/multiple_memoized_helpers.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ module RSpec
8282
# end
8383
#
8484
class MultipleMemoizedHelpers < Base
85-
include ConfigurableMax
8685
include Variable
8786

8887
MSG = 'Example group has too many memoized helpers [%<count>d/%<max>d]'
8988

89+
exclude_limit 'Max'
90+
9091
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
9192
return unless spec_group?(node)
9293

lib/rubocop/cop/rspec/nested_groups.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ module RSpec
9292
# end
9393
#
9494
class NestedGroups < Base
95-
include ConfigurableMax
9695
include TopLevelGroup
9796

9897
MSG = 'Maximum example group nesting exceeded [%<total>d/%<max>d].'
@@ -103,6 +102,8 @@ class NestedGroups < Base
103102
"Configuration key `#{DEPRECATED_MAX_KEY}` for #{cop_name} is " \
104103
'deprecated in favor of `Max`. Please use that instead.'
105104

105+
exclude_limit 'Max'
106+
106107
def on_top_level_group(node)
107108
find_nested_example_groups(node) do |example_group, nesting|
108109
self.max = nesting

0 commit comments

Comments
 (0)