Class: RuboCop::Cop::Obsession::Rspec::EmptyLineAfterFinalLet
- Inherits:
-
RSpec::EmptyLineAfterFinalLet
- Object
- RSpec::EmptyLineAfterFinalLet
- RuboCop::Cop::Obsession::Rspec::EmptyLineAfterFinalLet
- Defined in:
- lib/rubocop/cop/obsession/rspec/empty_line_after_final_let.rb
Overview
Same as RSpec/EmptyLineAfterFinalLet, but allows ‘let` to be followed by `it` with no new line, to allow for this style of spec:
Instance Method Summary collapse
Instance Method Details
#missing_separating_line(node) {|offending_loc(line)| ... } ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rubocop/cop/obsession/rspec/empty_line_after_final_let.rb', line 23 def (node) line = final_end_location(node).line line += 1 while comment_line?(processed_source[line]) return if processed_source[line].blank? return if processed_source[line].match?(/\s*it /) yield offending_loc(line) end |