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`.'
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_send(node) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rubocop/cop/rspec/message_chain.rb', line 23 def on_send(node) (node) do add_offense( node.loc.selector, message: format(MSG, method: node.method_name) ) end end |