Class: RuboCop::Cop::RSpec::DuplicatedMetadata

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
RangeHelp, Metadata
Defined in:
lib/rubocop/cop/rspec/duplicated_metadata.rb

Overview

Avoid duplicated metadata.

Examples:

# bad
describe 'Something', :a, :a

# good
describe 'Something', :a

Constant Summary collapse

MSG =
'Avoid duplicated metadata.'

Instance Method Summary collapse

Methods included from Metadata

#metadata_in_block, #on_block, #rspec_configure, #rspec_metadata

Methods included from RSpec::Language

#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?

Methods included from RSpec::Language::NodePattern

#block_or_numblock_pattern, #block_pattern, #numblock_pattern, #send_pattern

Methods inherited from Base

inherited, #on_new_investigation

Instance Method Details

#on_metadata(symbols, _hash) ⇒ Object



22
23
24
25
26
# File 'lib/rubocop/cop/rspec/duplicated_metadata.rb', line 22

def (symbols, _hash)
  symbols.each do |symbol|
    (symbol)
  end
end