# File lib/rspec/support/object_formatter.rb, line 190 def self.can_inspect?(object) object.inspect false rescue NoMethodError true end
# File lib/rspec/support/object_formatter.rb, line 197 def inspect "#<#{klass}:#{native_object_id}>" end
# File lib/rspec/support/object_formatter.rb, line 201 def klass singleton_class = class << object; self; end singleton_class.ancestors.find { |ancestor| !ancestor.equal?(singleton_class) } end
# File lib/rspec/support/object_formatter.rb, line 207 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