Test::Builder::Test
use Test::Builder::Test;
The Test::Builder::Test class represents a single test within the Test::Builder framework. The class itself is actually a factory for classes which does the Test::Builder::Test::Base role.
does
This is a Factory method used to create a specific class instances which perform the Test::Builder::Test::Base role.
$number
This is the test number.
$passed = 1
This parameter defaults to true, and so the factory returns a Test::Builder::Test::Pass instance, passing on the $description parameter, and setting the passed parameter to a true value.
$description
If this parameter is false, the factory returns a Test::Builder::Test::Fail instance, passing on the $description parameter and setting the passed parameter to a false value.
?$skip = 0
This parameter defaults to false. If it is true, the factory returns a Test::Builder::Test::Skip instance, passing on the $description and $reason parameters and a true value for the passed parameter.
$reason
?$todo = 0
This parameter defaults to false. If it is true, the factory returns a Test::Builder::Test::TODO instance, passing on the $description, $reason, and $passed parameters.
$passed
?$reason = ''
This parameter is for the skip and TODO tests and should contain a string describing why the test is a skip or TODO test.
?$description = ''
This parameter and contains the test description.
This role contains several public attributes.
Whether the test passed.
The number of the test in the current test file.
The test's description (optional).
The test's diagnostic message (optional).
This role contains two methods:
This returns a hash containing two keys, passed and description, from the test's attributes.
passed
description
This returns a string which follows the TAP protocol:
ok 1 - test description not ok 2 - test description # test diagnoistic
This role extends the Test::Builder::Test::Base role to add a simple public attribute.
It also overrides a single method:
This method calls the superclass status method and adds the values of the test's skip and reason attributes to the hash before returning it.
status
skip
reason
These first two classes perform the Test::Builder::Test::Base role.
Test::Builder::Test::Pass
Test::Builder::Test::Fail
These next two classes both perform the Test::Builder::Test::WithReason role and override some methods to provide additional features.
Test::Builder::Test::TODO
This overrides two methods.
This handles the specific details of TAP output for TODO tests.
This adds a TODO key, sets the passed key to true, and adds a really_passed key which contains the boolean representing if the test truly did pass.
TODO
really_passed
Test::Builder::Test::Skip
This also overrides two methods.
This handles the specific details of TAP output for Skip tests.
This sets the skip key to true in the hash.
Perl 5 Test::Builder and Test::Harness::TAP.
code by chromatic <chromatic@wgz.org>
documentation by Stevan Little <stevan@iinteractive.com> and chromatic.
1 POD Error
The following errors were encountered while parsing the POD:
You can't have =items (as at line 260) unless the first thing after the =over is an =item
To install Perl6::Pugs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl6::Pugs
CPAN shell
perl -MCPAN -e shell install Perl6::Pugs
For more information on module installation, please visit the detailed CPAN module installation guide.