Class: RuboCop::Cop::RSpec::RepeatedDescription
- Defined in:
- lib/rubocop/cop/rspec/repeated_description.rb
Overview
Check for repeated description strings in example groups.
Constant Summary collapse
- MSG =
"Don't repeat descriptions within an example group."
Instance Method Summary collapse
-
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler.
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language
#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Instance Method Details
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rubocop/cop/rspec/repeated_description.rb', line 45 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) repeated_descriptions(node).each do |description| add_offense(description) end repeated_its(node).each do |its| add_offense(its) end end |