class RSpec::Support::ObjectFormatter::UninspectableObjectInspector

def self.can_inspect?(object)

def self.can_inspect?(object)
  object.inspect
  false
rescue NoMethodError
  true
end

def inspect

def inspect
  "#<#{klass}:#{native_object_id}>"
end

def klass

def klass
  Support.class_of(object)
end

def native_object_id

http://stackoverflow.com/a/2818916
def native_object_id
  OBJECT_ID_FORMAT % (object.__id__ << 1)
rescue NoMethodError
  # In Ruby 1.9.2, BasicObject responds to none of #__id__, #object_id, #id...
  '-'
end