method
message_received
1.3.1 -
Show latest stable
- Class:
Spec::Mocks::Proxy
message_received(sym, *args, &block)public
No documentation available.
# File lib/spec/mocks/proxy.rb, line 104
def message_received(sym, *args, &block)
expectation = find_matching_expectation(sym, *args)
stub = find_matching_method_stub(sym, *args)
if ok_to_invoke_stub?(stub, expectation)
record_stub(stub, sym, args, &block)
elsif expectation
invoke_expectation(expectation, *args, &block)
elsif expectation = find_almost_matching_expectation(sym, *args)
record_almost_matching_expectation(expectation, sym, *args, &block)
elsif @target.is_a?(Class)
@target.superclass.send(sym, *args, &block)
else
@target.__send__ :method_missing, sym, *args, &block
end
end