class RuboCop::Cop::RSpec::MessageChain


allow(foo).to receive(:bar).and_return(thing)
thing = Thing.new(baz: 42)
# better
allow(foo).to receive_message_chain(:bar, :baz).and_return(42)
# bad
@example
Check that chains of messages are not being stubbed.

def on_send(node)

def on_send(node)
  message_chain(node) do
    add_offense(
      node.loc.selector,
      message: format(MSG, method: node.method_name)
    )
  end
end