    # File lib/spec/mocks/message_expectation.rb, line 149
          def invoke_with_yield(block)
            if block.nil?
              @error_generator.raise_missing_block_error @args_to_yield
            end
            value = nil
            @args_to_yield.each do |args_to_yield_this_time|
              if block.arity > -1 && args_to_yield_this_time.length != block.arity
                @error_generator.raise_wrong_arity_error args_to_yield_this_time, block.arity
              end
              value = block.call(*args_to_yield_this_time)
            end
            value
          end