Class: RuboCop::Cop::RSpec::EmptyLineAfterSubject
- Includes:
- RSpec::BlankLineSeparation
- Defined in:
- lib/rubocop/cop/rspec/empty_line_after_subject.rb
Overview
Checks if there is an empty line after subject block.
Constant Summary collapse
- MSG =
'Add empty line after `subject`.'
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
22 23 24 25 26 27 28 29 |
# File 'lib/rubocop/cop/rspec/empty_line_after_subject.rb', line 22 def on_block(node) return unless subject?(node) && !in_spec_block?(node) return if last_child?(node) (node) do |location| add_offense(node, location: location, message: MSG) end end |