method
message_received
message_received(sym, *args, &block)
public
Hide source
# File lib/spec/mocks/proxy.rb, line 63 def message_received(sym, *args, &block) if expectation = find_matching_expectation(sym, *args) expectation.invoke(args, block) elsif (stub = find_matching_method_stub(sym, *args)) if expectation = find_almost_matching_expectation(sym, *args) expectation.advise(args, block) unless expectation.expected_messages_received? end stub.invoke([], block) elsif expectation = find_almost_matching_expectation(sym, *args) expectation.advise(args, block) if null_object? unless expectation.expected_messages_received? raise_unexpected_message_args_error(expectation, *args) unless (has_negative_expectation?(sym) or null_object?) else @target.send :method_missing, sym, *args, &block end end