Class: MockObject

Inherits:
Object show all
Defined in:
lib/extensions/mspec/mspec/mocks/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ MockObject

Returns a new instance of MockObject.



2
3
4
5
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 2

def initialize(name, options={})
  @name = name
  @null = options[:null_object]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object (private)



7
8
9
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 7

def method_missing(sym, *args, &block)
  @null ? self : super
end