The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Matcher

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

  SupportedTypes();

Options

The SupportedTypes will return all supported matcher types as an array ref.

String

  String();
  String('abc');

Options

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.

Number

  Number();
  Number(123);

Options

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.

HashRef

  HashRef();
  HashRef({1 => 23});

Options

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.

ArrayRef

  ArrayRef();
  ArrayRef([1,23]);

Options

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.

Object

  Object();
  Object('Path::To::Object');

Options

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.

Function

  Function();

Options

The Function method will create the matcher in the needed structure to match a function pointer.

Undef

  Undef();

Options

The Undef method will create the matcher in the needed structure to match an undefined value.

Any

  Any();

Options

The Any method will create the matcher in the needed structure to match any type of parameter.

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 <cbreitkreutz@epages.com>