Class: RuboCop::Cop::RSpec::RepeatedExampleGroupBody
- Defined in:
- lib/rubocop/cop/rspec/repeated_example_group_body.rb
Overview
Check for repeated describe and context block body.
Constant Summary collapse
- MSG =
'Repeated %<group>s block body on line(s) %<loc>s'
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_begin(node) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/rubocop/cop/rspec/repeated_example_group_body.rb', line 61 def on_begin(node) return unless several_example_groups?(node) repeated_group_bodies(node).each do |group, repeats| add_offense(group, message: (group, repeats)) end end |