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

Inherits:
Base
  • 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.'

Instance Method Summary collapse

Methods inherited from Base

inherited, #on_new_investigation

Methods included from RSpec::Language::NodePattern

#block_pattern, #send_pattern

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)
  end
end