# File lib/facon/expectation.rb, line 57 def invoke(args, block) begin raise @exception_to_raise unless @exception_to_raise.nil? throw @symbol_to_throw unless @symbol_to_throw.nil? return_value = if !@method_block.nil? invoke_method_block(args) elsif @args_to_yield.size > 0 @args_to_yield.each { |curr_args| block.call(*curr_args) } else nil end if defined?(@return_block) && @return_block args << block unless block.nil? @return_block.call(*args) else return_value end ensure @actual_received_count += 1 end end