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
25 26 27 28 29 30 31 32 |
# File 'lib/rubocop/cop/obsession/rspec/empty_line_after_final_let.rb', line 25 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 |