vendor/gems/flexmock-0.8.5/lib/flexmock/expectation.rb
def perform_yielding(args)
      @return_value = nil
      unless @yield_queue.empty?
        block = args.last
        values = (@yield_queue.size == 1) ? @yield_queue.first : @yield_queue.shift
        if block && block.respond_to?(:call) 
          @return_value = block.call(*values)
        else
          fail MockError, "No Block given to mock with 'and_yield' expectation"
        end
      end
    end
# Yield stored values to any blocks given.
Yield stored values to any blocks given.
Yield stored values to any blocks given .
def perform_yielding(args)
      @return_value = nil
      unless @yield_queue.empty?
        block = args.last
        values = (@yield_queue.size == 1) ? @yield_queue.first : @yield_queue.shift
        if block && block.respond_to?(:call) 
          @return_value = block.call(*values)
        else
          fail MockError, "No Block given to mock with 'and_yield' expectation"
        end
      end
    end
def perform_yielding ( args ) @return_value = nil unless @yield_queue . empty? block = args . last values = ( @yield_queue . size == 1 ) ? @yield_queue . first : @yield_queue . shift if block && block . respond_to? ( :call ) @return_value = block . call ( * values ) else fail MockError , "No Block given to mock with 'and_yield' expectation" end end end
Yield stored values to any blocks given.
Yield stored values to any blocks given .
args