class Mocha::YieldParameters

Public Class Methods

new() click to toggle source
# File lib/mocha/yield_parameters.rb, line 7
def initialize
  @parameter_groups = []
end

Public Instance Methods

add(*parameters) click to toggle source
# File lib/mocha/yield_parameters.rb, line 19
def add(*parameters)
  @parameter_groups << SingleYield.new(*parameters)
end
multiple_add(*parameter_groups) click to toggle source
# File lib/mocha/yield_parameters.rb, line 23
def multiple_add(*parameter_groups)
  @parameter_groups << MultipleYields.new(*parameter_groups)
end
next_invocation() click to toggle source
# File lib/mocha/yield_parameters.rb, line 11
def next_invocation
  case @parameter_groups.length
  when 0 then NoYields.new
  when 1 then @parameter_groups.first
  else @parameter_groups.shift
  end
end