class RuboCop::Cop::RSpec::AlignRightLetBrace
Checks that right braces for adjacent single line lets are aligned.
@example
# bad let(:foobar) { blahblah } let(:baz) { bar } let(:a) { b } # good let(:foobar) { blahblah } let(:baz) { bar } let(:a) { b }
Constants
- MSG
Public Class Methods
Source
# File lib/rubocop/cop/rspec/align_right_let_brace.rb, line 24 def self.autocorrect_incompatible_with [Layout::ExtraSpacing] end
Public Instance Methods
Source
# File lib/rubocop/cop/rspec/align_right_let_brace.rb, line 28 def on_new_investigation super return if processed_source.blank? token_aligner.offending_tokens.each do |let| add_offense(let.loc.end) do |corrector| corrector.insert_before( let.loc.end, token_aligner.indent_for(let) ) end end end
Calls superclass method
Private Instance Methods
Source
# File lib/rubocop/cop/rspec/align_right_let_brace.rb, line 43 def token_aligner RuboCop::RSpec::AlignLetBrace.new(processed_source.ast, :end) end