Object
@api private
# File lib/rspec/mocks/space.rb, line 38 def any_instance_recorder_for(klass) id = klass.__id__ any_instance_recorders.fetch(id) do any_instance_recorders[id] = AnyInstance::Recorder.new(klass) end end
# File lib/rspec/mocks/space.rb, line 34 def expectation_ordering @expectation_ordering ||= OrderGroup.new end
# File lib/rspec/mocks/space.rb, line 70 def id_for(object) id = object.__id__ return id if object.equal?(::ObjectSpace._id2ref(id)) # this suggests that object.__id__ is proxying through to some wrapped object object.instance_eval do @__id_for_rspec_mocks_space ||= ::SecureRandom.uuid end end
# File lib/rspec/mocks/space.rb, line 49 def proxy_for(object) id = id_for(object) proxies.fetch(id) do proxies[id] = case object when NilClass then ProxyForNil.new when TestDouble then object.__build_mock_proxy else Proxy.new(object) end end end
# File lib/rspec/mocks/space.rb, line 63 def registered?(object) proxies.has_key?(id_for object) end
# File lib/rspec/mocks/space.rb, line 45 def remove_any_instance_recorder_for(klass) any_instance_recorders.delete(klass.__id__) end
Generated with the Darkfish Rdoc Generator 2.