| Module | RSpec::Mocks::TestDouble |
| In: |
lib/rspec/mocks/test_double.rb
|
Implements the methods needed for a pure test double. RSpec::Mocks::Mock includes this module, and it is provided for cases where you want a pure test double without subclassing RSpec::Mocks::Mock.
Extends the TestDouble module onto the given object and initializes it as a test double.
@example
module = Module.new RSpec::Mocks::TestDouble.extend_onto(module, "MyMixin", :foo => "bar") module.foo #=> "bar"
Creates a new test double with a `name` (that will be used in error messages only)
This allows for comparing the mock to other objects that proxy such as ActiveRecords belongs_to proxy objects. By making the other object run the comparison, we‘re sure the call gets delegated to the proxy target.