Class: RuboCop::Cop::RSpec::EmptyLineAfterHook
- Includes:
- RSpec::BlankLineSeparation
- Defined in:
- lib/rubocop/cop/rspec/empty_line_after_hook.rb
Overview
Checks if there is an empty line after hook blocks.
Constant Summary collapse
- MSG =
'Add an empty line after `%<hook>s`.'
Constants inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
RSpec::Language::ALL, RSpec::Language::RSPEC
Instance Method Summary collapse
Methods included from RSpec::BlankLineSeparation
#autocorrect, #last_child?, #missing_separating_line, #offending_loc
Methods included from RSpec::FinalEndLocation
Methods inherited from Cop
Instance Method Details
#on_block(node) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rubocop/cop/rspec/empty_line_after_hook.rb', line 41 def on_block(node) return unless hook?(node) return if last_child?(node) (node) do |location| add_offense( node, location: location, message: format(MSG, hook: node.method_name) ) end end |