my $truth = Test::CallFlow::ArgCheck::Code ->new( test => sub { my ($self, $at, $args) = @_; ref $args->[$at] =~ $self->{re} }, re => qr/Good/ ) ->check( bless {}, 'My::Godness' );
Delegates decision about validity of arguments to associated code reference (sub).
See base class Test::CallFlow::ArgCheck.
Test::CallFlow::ArgCheck
$checker->check( 1, [ 'foo', 'bar' ] ) ? 'ok' : die;
Checks given argument by calling associated code reference with it.
Arguments passed to called sub are
0. this ArgChecker object 1. position of argument to test 2. reference to array of arguments.
This way the associated sub can be written like a member of this class, using its properties.
To install Test::CallFlow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::CallFlow
CPAN shell
perl -MCPAN -e shell install Test::CallFlow
For more information on module installation, please visit the detailed CPAN module installation guide.