Sha256: fa5796a9cc53bf52ec6b74e6de69633a0708d1599be1e61bf1f6321fc67d43e4
Contents?: true
Size: 533 Bytes
Versions: 33
Compression:
Stored size: 533 Bytes
Contents
require 'mocha/single_return_value' module Mocha class ReturnValues def self.build(*values) new(*values.map { |value| SingleReturnValue.new(value) }) end attr_accessor :values def initialize(*values) @values = values end def next(invocation) case @values.length when 0 then nil when 1 then @values.first.evaluate(invocation) else @values.shift.evaluate(invocation) end end def +(other) self.class.new(*(@values + other.values)) end end end
Version data entries
33 entries across 33 versions & 2 rubygems