HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-3.0.2/spec/mspec/lib/mspec/utils/format.rb
# If the implementation on which the specs are run cannot
# load pp from the standard library, add a pp.rb file that
# defines the #pretty_inspect method on Object or Kernel.
begin
  require 'pp'
rescue LoadError
  module Kernel
    def pretty_inspect
      inspect
    end
  end
end

module MSpec
  def self.format(obj)
    if String === obj and obj.include?("\n")
      "\n#{obj.inspect.gsub('\n', "\n")}"
    else
      obj.pretty_inspect.chomp
    end
  rescue => e
    "#<#{obj.class}>(#pretty_inspect raised #{e.inspect})"
  end
end