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.

Methods

==   extend_onto   inspect   new   respond_to?   to_s   to_str  

Included Modules

Methods

Public Class methods

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)

Public Instance methods

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.

@private

@private

to_str()

Alias for to_s

[Validate]