Class: RuboCop::Cop::RSpec::EmptyLineAfterSubject
- Extended by:
- AutoCorrector
- Includes:
- EmptyLineSeparation, InsideExampleGroup
- 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 an empty line after `%<subject>s`.'
Instance Method Summary collapse
-
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler.
Methods included from EmptyLineSeparation
#last_child?, #missing_separating_line, #missing_separating_line_offense, #offending_loc
Methods included from FinalEndLocation
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language
#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Instance Method Details
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler
25 26 27 28 29 30 31 32 |
# File 'lib/rubocop/cop/rspec/empty_line_after_subject.rb', line 25 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless subject?(node) return unless inside_example_group?(node) (node) do |method| format(MSG, subject: method) end end |