Class goog.testing.mockmatchers.ArgumentMatcher

code »

A simple interface for executing argument matching. A match in this case is testing to see if a supplied object fits a given criteria. True is returned if the given criteria is met.

Constructor

goog.testing.mockmatchers.ArgumentMatcher ( opt_matchFn, opt_matchName )
Parameters
opt_matchFn: Function=
A function that evaluates a given argument and returns true if it meets a given criteria.
opt_matchName: ?string=
The name expressing intent as part of an error message for when a match fails.
Show:

Instance Methods

code »matches ( toVerify, opt_expectation )boolean

A function that takes a match argument and an optional MockExpectation which (if provided) will get error information and returns whether or not it matches.

Parameters
toVerify: *
The argument that should be verified.
opt_expectation: ?goog.testing.MockExpectation=
The expectation for this match.
Returns
Whether or not a given argument passes verification.

Instance Properties

A function that evaluates a given argument and returns true if it meets a given criteria.

A string indicating the match intent (e.g. isBoolean or isString).