Class: RuboCop::Cop::RSpec::HooksBeforeExamples
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/rspec/hooks_before_examples.rb
Overview
Checks for before/around/after hooks that come after an example.
Constant Summary collapse
- MSG =
'Move `%<hook>s` above the examples in the group.'
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_block(node) ⇒ Object
38 39 40 41 42 |
# File 'lib/rubocop/cop/rspec/hooks_before_examples.rb', line 38 def on_block(node) return unless example_group_with_body?(node) check_hooks(node.body) if multiline_block?(node.body) end |