Test::Proto::CodeRef - Test a coderef's behaviour
$p->call(['test.txt','>'], [$fh])->ok($subject);
Takes two arguments: first, the arguments to pass to the code, second the expected return value. Passes the arguments to the test subject, and tests the return value against the expected value.
The arguments and return value should be arrayrefs; the code is evaluated in list context.
$p->call_void_context(['test.txt','>'])->ok($subject);
Takes one argument: the arguments to use with the method, as an arrayref. Calls the method on the test subject, with the arguments. This test will always pass, unless the code dies, or is not code.
$p->call_scalar_context(['test.txt','>'], $true)->ok($subject);
The arguments should be an arrayref, and the expected value should be a prototype evaluating the returned scalar, as the method is evaluated in scalar context.
$p->call_list_context(['test.txt','>'], [$true])->ok($subject);
For author, version, bug reports, support, etc, please see Test::Proto.
To install Test::Proto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Proto
CPAN shell
perl -MCPAN -e shell install Test::Proto
For more information on module installation, please visit the detailed CPAN module installation guide.