Class: Rubocop::Cop::RSpec::EmptyLineAfterLetBlock
- Inherits:
-
Base
- Object
- RuboCop::Cop::RSpec::Base
- Base
- Rubocop::Cop::RSpec::EmptyLineAfterLetBlock
- Extended by:
- RuboCop::Cop::AutoCorrector
- Includes:
- RuboCop::Cop::RSpec::EmptyLineSeparation
- Defined in:
- lib/rubocop/cop/rspec/empty_line_after_let_block.rb
Overview
Checks if there is an empty line after let blocks.
Constant Summary collapse
- MSG =
'Add an empty line after `%<let>s` block.'
Instance Method Summary collapse
- #on_block(node) ⇒ Object (also: #on_numblock)
Instance Method Details
#on_block(node) ⇒ Object Also known as: on_numblock
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rubocop/cop/rspec/empty_line_after_let_block.rb', line 46 def on_block(node) RuboCop::RSpec::ExampleGroup.new(node).lets.each do |let| break if last_child?(let) next if let.single_line? (let) do |method| format(MSG, let: method) format(MSG, let: method) end end end |