Class: RuboCop::Cop::RSpec::DescribeSymbol

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/rspec/describe_symbol.rb

Overview

Avoid describing symbols.

Examples:

# bad
describe :my_method do
  ...
end

# good
describe '#my_method' do
  ...
end

See Also:

Constant Summary collapse

MSG =
'Avoid describing symbols.'.freeze

Constants inherited from Cop

Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE

Constants included from RSpec::Language

RSpec::Language::ALL

Instance Method Summary collapse

Methods inherited from Cop

inherited, #relevant_file?

Instance Method Details

#on_send(node) ⇒ Object



27
28
29
30
31
# File 'lib/rubocop/cop/rspec/describe_symbol.rb', line 27

def on_send(node)
  describe_symbol?(node) do |match|
    add_offense(match, location: :expression)
  end
end