diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b038f06..66fa709c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Master (Unreleased) - Add support for Unicode RIGHT SINGLE QUOTATION MARK in `RSpec/ExampleWording`. ([@jdufresne]) +- Suppress deprecation warning for `RSpec/MultipleExpectations`, `RSpec/MultipleMemoizedHelpers`, and `RSpec/NestedGroups` cops. ([@koic]) ## 3.0.2 (2024-07-02) diff --git a/lib/rubocop/cop/rspec/multiple_expectations.rb b/lib/rubocop/cop/rspec/multiple_expectations.rb index 2d51f218d..bb1a32297 100644 --- a/lib/rubocop/cop/rspec/multiple_expectations.rb +++ b/lib/rubocop/cop/rspec/multiple_expectations.rb @@ -67,13 +67,13 @@ module RSpec # end # class MultipleExpectations < Base - include ConfigurableMax - MSG = 'Example has too many expectations [%d/%d].' ANYTHING = ->(_node) { true } TRUE_NODE = lambda(&:true_type?) + exclude_limit 'Max' + # @!method aggregate_failures?(node) def_node_matcher :aggregate_failures?, <<~PATTERN (block { diff --git a/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb b/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb index e386c5c68..b15dba208 100644 --- a/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +++ b/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb @@ -82,11 +82,12 @@ module RSpec # end # class MultipleMemoizedHelpers < Base - include ConfigurableMax include Variable MSG = 'Example group has too many memoized helpers [%d/%d]' + exclude_limit 'Max' + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless spec_group?(node) diff --git a/lib/rubocop/cop/rspec/nested_groups.rb b/lib/rubocop/cop/rspec/nested_groups.rb index 2529621ac..40e5aa2d8 100644 --- a/lib/rubocop/cop/rspec/nested_groups.rb +++ b/lib/rubocop/cop/rspec/nested_groups.rb @@ -92,7 +92,6 @@ module RSpec # end # class NestedGroups < Base - include ConfigurableMax include TopLevelGroup MSG = 'Maximum example group nesting exceeded [%d/%d].' @@ -103,6 +102,8 @@ class NestedGroups < Base "Configuration key `#{DEPRECATED_MAX_KEY}` for #{cop_name} is " \ 'deprecated in favor of `Max`. Please use that instead.' + exclude_limit 'Max' + def on_top_level_group(node) find_nested_example_groups(node) do |example_group, nesting| self.max = nesting