Class: RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup
- Includes:
- RSpec::BlankLineSeparation
- Defined in:
- lib/rubocop/cop/rspec/empty_line_after_example_group.rb
Overview
Checks if there is an empty line after example group blocks.
Constant Summary collapse
- MSG =
'Add an empty line after `%<example_group>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
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rubocop/cop/rspec/empty_line_after_example_group.rb', line 31 def on_block(node) return unless example_group?(node) return if last_child?(node) (node) do |location| add_offense( node, location: location, message: format(MSG, example_group: node.method_name) ) end end |