Test::Pockito::DefaultMatcher
Default matching for Pockito
Default implementation of matching. If none of the any_* subs are used for matching, then it reverts to a ne op for matching.
This is the default matching metchanism for Pockito though you are at will to implement your own. Passing an implementation with this signature overrides the matching sub. The default implementation does not use $package nor $method, but they will be of use if you have multiple, different ways to define parameters as equal.
All the following matchers can be exported or refered to by package name. They use Scalar::Util::Reftype under the hood except for is_defined.
is_defined is_scalar is_array is_hash is_code is_global is_lvalue is_regexp is_scalar_object is_array_object is_hash_object is_code_object is_glob_object is_lvalue_object is_ref_object is_io_object is_regexp_object
With these, one can write:
$pocket->when( $mock->( is_defined, is_regexp, 1, 2, is_code_object )->...
to match
any defined value any regular expression ref the value 1 the value 2 any blessed code ref
exussum@gmail.com
Spencer Portee CPAN ID: EXUSSUM exussum@gmail.com
http://bitbucket.org/exussum/pockito/
This program is free software licensed under the...
The BSD License
The full text of the license can be found in the LICENSE file included with this module.
perl(1).
To install Test::Pockito, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Pockito
CPAN shell
perl -MCPAN -e shell install Test::Pockito
For more information on module installation, please visit the detailed CPAN module installation guide.