class RuboCop::Cop::RSpec::MissingExpectationTargetMethod


expect{something}.to raise_error BarError
is_expected.to eq 42
expect(something).to be_a Foo
# good
expect{something}.eq? BarError
is_expected == 42
expect(something).kind_of? Foo
# bad
@example
`to_not` to run. Therefore, this cop checks if other methods are used.
The RSpec::Expectations::ExpectationTarget must use ‘to`, `not_to` or
Checks if `.to`, `not_to` or `to_not` are used.

def on_send(node)

def on_send(node)
  node = node.parent if node.parent&.block_type?
  expectation_without_runner?(node.parent) do
    add_offense(node.parent.loc.selector)
  end
end