module RSpec::Support

def self.class_of(object)

Other tags:
    Api: - private
def self.class_of(object)
  object.class
rescue NoMethodError
  singleton_class = class << object; self; end
  singleton_class.ancestors.find { |ancestor| !ancestor.equal?(singleton_class) }
end