Class: RuboCop::Cop::RSpec::MessageChain
- Defined in:
- lib/rubocop/cop/rspec/message_chain.rb
Overview
Check that chains of messages are not being stubbed.
Constant Summary collapse
- MSG =
'Avoid stubbing using `%<method>s`.'
Constants inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
RSpec::Language::ALL, RSpec::Language::RSPEC
Instance Method Summary collapse
Methods inherited from Cop
Instance Method Details
#message(node) ⇒ Object
27 28 29 |
# File 'lib/rubocop/cop/rspec/message_chain.rb', line 27 def (node) format(MSG, method: node.method_name) end |
#on_send(node) ⇒ Object
23 24 25 |
# File 'lib/rubocop/cop/rspec/message_chain.rb', line 23 def on_send(node) (node) { add_offense(node, location: :selector) } end |