Method: Spec::Mocks::Mock#initialize
- Defined in:
- lib/spec/mocks/mock.rb
#initialize(name = nil, stubs_and_options = {}) ⇒ Mock
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.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/spec/mocks/mock.rb', line 10 def initialize(name=nil, ={}) if name.is_a?(Hash) && .empty? = name @name = nil else @name = name end @options = () assign_stubs() end |