Sha256: e804d9e0a12fdd8f784352799655408ccd229727d5d6b1854bbfd1afea73b5ec

Contents?: true

Size: 592 Bytes

Versions: 61

Compression:

Stored size: 592 Bytes

Contents

require 'mocha/no_yields'
require 'mocha/single_yield'
require 'mocha/multiple_yields'

module Mocha

  class YieldParameters

    def initialize
      @parameter_groups = []
    end

    def next_invocation
      case @parameter_groups.length
        when 0 then NoYields.new
        when 1 then @parameter_groups.first
        else @parameter_groups.shift
      end
    end

    def add(*parameters)
      @parameter_groups << SingleYield.new(*parameters)
    end

    def multiple_add(*parameter_groups)
      @parameter_groups << MultipleYields.new(*parameter_groups)
    end

  end

end

Version data entries

61 entries across 50 versions & 5 rubygems

Version Path
mocha-1.6.0 lib/mocha/yield_parameters.rb
mocha-1.5.0 lib/mocha/yield_parameters.rb
mocha-1.4.0 lib/mocha/yield_parameters.rb
mocha-1.3.0 lib/mocha/yield_parameters.rb
mocha-1.2.1 lib/mocha/yield_parameters.rb
mocha-1.2.0 lib/mocha/yield_parameters.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/mocha-1.0.0/lib/mocha/yield_parameters.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/mocha-1.0.0/lib/mocha/yield_parameters.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/mocha-1.0.0/lib/mocha/yield_parameters.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/mocha-1.0.0/lib/mocha/yield_parameters.rb
mocha-1.1.0 lib/mocha/yield_parameters.rb
mocha-1.0.0 lib/mocha/yield_parameters.rb
mocha-1.0.0.alpha lib/mocha/yield_parameters.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/mocha-0.14.0/lib/mocha/yield_parameters.rb
challah-1.0.0 vendor/bundle/gems/mocha-0.14.0/lib/mocha/yield_parameters.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/mocha-0.14.0/lib/mocha/yield_parameters.rb
mocha-0.14.0 lib/mocha/yield_parameters.rb
challah-1.0.0.beta3 vendor/bundle/gems/mocha-0.13.3/lib/mocha/yield_parameters.rb
mocha-0.14.0.alpha lib/mocha/yield_parameters.rb
challah-1.0.0.beta2 vendor/bundle/gems/mocha-0.13.3/lib/mocha/yield_parameters.rb