Class Spec::Mocks::Mock
In: lib/spec/mocks/mock.rb
Parent: Object


==   inspect   method_missing   new   to_s  

Included Modules


Public Class methods

Creates a new mock with a name (that will be used in error messages only) == Options:

  • :null_object - if true, the mock object acts as a forgiving null object allowing any message to be sent to it.

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 This is an unfortunate side effect from ActiveRecord, but this should be safe unless the RHS redefines == in a nonsensical manner