Class: RuboCop::Cop::RSpec::ContextMethod
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/rspec/context_method.rb
Overview
‘context` should not be used for specifying methods.
Constant Summary collapse
- MSG =
'Use `describe` for testing methods.'
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_block(node) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/rubocop/cop/rspec/context_method.rb', line 35 def on_block(node) context_method(node) do |context| add_offense(context) do |corrector| corrector.replace(node.send_node.loc.selector, 'describe') end end end |