Name
Test::Mockify::Matcher - To define parameter matchers
DESCRIPTION
Use Test::Mockify::Matcher to define different types of expected parameters. See method description for more details.
METHODS
SupportedTypes
The SupportedTypes
will return all supported matcher types as an array ref.
SupportedTypes();
String
The String
method will create the matcher in the needed structure to match a string. If called with parameter, it will be proved that this value is actually a string. If not, it will create an error. Use the Matcher Number() to Check for the string '0' (perl cannot differ that)
String();
String('abc');
Number
The Number
method will create the matcher in the needed structure to match a number. If called with parameter, it will be proved that this value is actually a number. If not, it will create an error.
Number();
Number(123);
Number(45.67);
HashRef
The HashRef
method will create the matcher in the needed structure to match a hash reference. If called with parameter, it will be proved that this value is actually a hash reference. If not, it will create an error.
HashRef();
HashRef({1 => 23});
ArrayRef
The ArrayRef
method will create the matcher in the needed structure to match an array reference. If called with parameter, it will be proved that this value is actually an array reference. If not, it will create an error.
ArrayRef();
ArrayRef([1,23]);
Object
The Object
method will create the matcher in the needed structure to match an object. If called with parameter, it will be proved that this value is actually an string of the object path. If not, it will create an error.
Object();
Object('Path::To::Object');
Function
The Function
method will create the matcher in the needed structure to match a function pointer.
Function();
Undef
The Undef
method will create the matcher in the needed structure to match an undefined value.
Undef();
Any
The Any
method will create the matcher in the needed structure to match any type of parameter.
Any();
LICENSE
Copyright (C) 2017 ePages GmbH
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Christian Breitkreutz <christianbreitkreutz@gmx.de>