Method: RSpec::Mocks::ExampleMethods#class_double
- Defined in:
- lib/rspec/mocks/example_methods.rb
#class_double(doubled_class) ⇒ Object #class_double(doubled_class, name) ⇒ Object #class_double(doubled_class, stubs) ⇒ Object #class_double(doubled_class, name, stubs) ⇒ Object
Constructs a test double against a specific class. If the given class name has been loaded, only class methods defined on the class are allowed to be stubbed. In all other ways it behaves like a double.
79 80 81 82 |
# File 'lib/rspec/mocks/example_methods.rb', line 79 def class_double(doubled_class, *args) ref = ObjectReference.for(doubled_class) ExampleMethods.(ClassVerifyingDouble, ref, *args) end |