Class: RuboCop::Cop::RSpec::DescribeSymbol
- Defined in:
- lib/rubocop/cop/rspec/describe_symbol.rb
Overview
Avoid describing symbols.
Constant Summary collapse
- MSG =
'Avoid describing symbols.'
- RESTRICT_ON_SEND =
%i[describe].freeze
Instance Method Summary collapse
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
#describe_symbol?(node) ⇒ Object
25 26 27 |
# File 'lib/rubocop/cop/rspec/describe_symbol.rb', line 25 def_node_matcher :describe_symbol?, <<~PATTERN (send #rspec? :describe $sym ...) PATTERN |
#on_send(node) ⇒ Object
29 30 31 32 33 |
# File 'lib/rubocop/cop/rspec/describe_symbol.rb', line 29 def on_send(node) describe_symbol?(node) do |match| add_offense(match) end end |