lib/rubocop/cop/rspec/nested_groups.rb in rubocop-rspec-1.42.0 vs lib/rubocop/cop/rspec/nested_groups.rb in rubocop-rspec-1.43.0
- old
+ new
@@ -83,23 +83,23 @@
# it 'yada yada'
# end
# end
# end
#
- class NestedGroups < Cop
+ class NestedGroups < Base
include ConfigurableMax
- include RuboCop::RSpec::TopLevelDescribe
+ include RuboCop::RSpec::TopLevelGroup
MSG = 'Maximum example group nesting exceeded [%<total>d/%<max>d].'
DEPRECATED_MAX_KEY = 'MaxNesting'
DEPRECATION_WARNING =
"Configuration key `#{DEPRECATED_MAX_KEY}` for #{cop_name} is " \
'deprecated in favor of `Max`. Please use that instead.'
- def on_top_level_describe(node, _args)
- find_nested_example_groups(node.parent) do |example_group, nesting|
+ def on_top_level_group(node)
+ find_nested_example_groups(node) do |example_group, nesting|
self.max = nesting
add_offense(
example_group.send_node,
message: message(nesting)
)