class RuboCop::Cop::RSpec::IncludeExamples
it_behaves_like ‘examples’
# good
include_examples ‘examples’
# bad
@example
Prefer using ‘it_behaves_like` instead.
unexpected behavior and side effects.
within shared examples included with `include_examples` can have
own context. As such, using `subject`, `let`, `before`/`after`, etc.
`include_examples`, unlike `it_behaves_like`, does not create its
Checks for usage of `include_examples`.
def on_send(node)
def on_send(node) selector = node.loc.selector add_offense(selector) do |corrector| corrector.replace(selector, 'it_behaves_like') end end