class RuboCop::RSpec::ExpectOffense::AnnotatedSource

def with_offense_annotations(offenses)

Returns:
  • (self) -

Parameters:
  • offenses (Array) --
def with_offense_annotations(offenses)
  offense_annotations =
    offenses.map do |offense|
      indent     = ' ' * offense.column
      carets     = '^' * offense.column_length
      [offense.line, "#{indent}#{carets} #{offense.message}\n"]
    end
  self.class.new(lines, offense_annotations)
end