Method: PP::ObjectMixin#pretty_print_inspect

Defined in:
lib/extensions/mspec/mspec/pp.rb

#pretty_print_inspectObject

Is #inspect implementation using #pretty_print. If you implement #pretty_print, it can be used as follows.

alias inspect pretty_print_inspect

However, doing this requires that every class that #inspect is called on implement #pretty_print, or a RuntimeError will be raised.



695
696
697
698
699
700
# File 'lib/extensions/mspec/mspec/pp.rb', line 695

def pretty_print_inspect
  if /\(PP::ObjectMixin\)#/ =~ Object.instance_method(:method).bind(self).call(:pretty_print).inspect
    raise "pretty_print is not overridden for #{self.class}"
  end
  PP.singleline_pp(self, '')
end