Class: RuboCop::Cop::RSpec::ItBehavesLike
- Extended by:
- AutoCorrector
- Includes:
- ConfigurableEnforcedStyle
- Defined in:
- lib/rubocop/cop/rspec/it_behaves_like.rb
Overview
Checks that only one ‘it_behaves_like` style is used.
Constant Summary collapse
- MSG =
'Prefer `%<replacement>s` over `%<original>s` when including ' \ 'examples in a nested context.'
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
30 31 32 33 34 35 36 |
# File 'lib/rubocop/cop/rspec/it_behaves_like.rb', line 30 def on_send(node) example_inclusion_offense(node, alternative_style) do add_offense(node) do |corrector| corrector.replace(node.loc.selector, style.to_s) end end end |