Parameter matcher which allows optional parameters to be specified.
@private
# File lib/mocha/parameter_matchers/optionally.rb, line 48 48: def matches?(available_parameters) 49: index = 0 50: while (available_parameters.length > 0) && (index < @matchers.length) do 51: matcher = @matchers[index] 52: return false unless matcher.matches?(available_parameters) 53: index += 1 54: end 55: return true 56: end 57: 58: # @private 59: def mocha_inspect 60: "optionally(#{@matchers.map { |matcher| matcher.mocha_inspect }.join(", ") })" 61: end 62: 63: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.