class PowerAssert::Formatter

Public Class Methods

new(value, indent) click to toggle source
# File lib/power_assert/inspector.rb, line 38
def initialize(value, indent)
  @value = value
  @indent = indent
end

Public Instance Methods

inspect() click to toggle source
# File lib/power_assert/inspector.rb, line 43
def inspect
  if PowerAssert.configuration._colorize_message
    if PowerAssert.configuration._use_pp
      width = [Pry::Terminal.width! - 1 - @indent, 10].max
      Pry::ColorPrinter.pp(@value, '', width)
    else
      Pry::Code.new(@value.inspect).highlighted
    end
  else
    if PowerAssert.configuration._use_pp
      PP.pp(@value, '')
    else
      @value.inspect
    end
  end
end