Class Index [+]

Quicksearch

Mocha::ParameterMatchers::HasValue

Parameter matcher which matches when actual parameter contains Hash entry with expected value.

Public Class Methods

new(value) click to toggle source

@private

    # File lib/mocha/parameter_matchers/has_value.rb, line 33
33:       def initialize(value)
34:         @value = value
35:       end

Public Instance Methods

matches?(available_parameters) click to toggle source

@private

    # File lib/mocha/parameter_matchers/has_value.rb, line 38
38:       def matches?(available_parameters)
39:         parameter = available_parameters.shift
40:         return false unless parameter.respond_to?(:values)
41:         parameter.values.any? { |value| @value.to_matcher.matches?([value]) }
42:       end
mocha_inspect() click to toggle source

@private

    # File lib/mocha/parameter_matchers/has_value.rb, line 45
45:       def mocha_inspect
46:         "has_value(#{@value.mocha_inspect})"
47:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.