Module: Aruba::Matchers::Base::MessageIndenter Private

Defined in:
lib/aruba/matchers/base/message_indenter.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provide #indent_multiline_message helper method.

Class Method Summary collapse

Class Method Details

.indent_multiline_message(message) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
# File 'lib/aruba/matchers/base/message_indenter.rb', line 10

def indent_multiline_message(message)
  message = message.sub(/\n+\z/, "")
  message.lines.map do |line|
    /\S/.match?(line) ? "   #{line}" : line
  end.join
end