class Mocha::Expectation

def with(*expected_parameters_or_matchers, &matching_block)

Other tags:
    Example: Expected method must be called with a value divisible by 4. -
    Example: Strict keyword argument matching -
    Example: Loose keyword argument matching (default) -
    Example: Expected method must be called with parameters matching parameter matchers. -
    Example: Expected method must be called with exact parameter values. -

Returns:
  • (Expectation) - the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.

Other tags:
    Yieldreturn: - +true+ if +actual_parameters+ are acceptable.

Other tags:
    Yieldparam: actual_parameters - parameters with which expected method was invoked.

Other tags:
    Yield: - optional block specifying custom matching.

Parameters:
  • expected_parameters_or_matchers (*Array) -- expected parameter values or parameter matchers.

Other tags:
    See: Configuration#strict_keyword_argument_matching= -
    See: ParameterMatchers -
def with(*expected_parameters_or_matchers, &matching_block)
  @parameters_matcher = ParametersMatcher.new(expected_parameters_or_matchers, self, &matching_block)
  self
end