Class: RR::DoubleDefinitions::Strategies::DoubleInjection::AnyInstanceOf

Inherits:
DoubleInjectionStrategy show all
Defined in:
lib/rr/double_definitions/strategies/double_injection/any_instance_of.rb

Overview

This class is Deprecated. Calling instance_of will cause all instances of the passed in Class to have the Double defined.

The following example mocks all User's valid? method and return false.

mock.instance_of(User).valid? {false}

The following example mocks and proxies User#projects and returns the first 3 projects.

mock.instance_of(User).projects do |projects|
  projects[0..2]
end

Instance Attribute Summary

Attributes inherited from Strategy

#args, #definition, #double_definition_create, #handler, #method_name

Method Summary

Methods inherited from Strategy

#call, #initialize, #verify_subject

Methods included from Space::Reader

#space

Constructor Details

This class inherits a constructor from RR::DoubleDefinitions::Strategies::Strategy