Method: FlexMock#method_missing

Defined in:
lib/gems/flexmock-0.8.3/lib/flexmock/core.rb

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

Handle missing methods by attempting to look up a handler.



97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/core.rb', line 97

def method_missing(sym, *args, &block)
  flexmock_wrap do
    if handler = @expectations[sym]
      args << block  if block_given?
      handler.call(*args)
    elsif @ignore_missing
      FlexMock.undefined
    else
      super(sym, *args, &block)
    end
  end
end