.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::Roo::Class 3pm" .TH Test::Roo::Class 3pm "2021-01-07" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Roo::Class \- Base class for Test::Roo test classes .SH "VERSION" .IX Header "VERSION" version 1.004 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is the base class for Test::Roo test classes. It provides methods to run tests and anchor modifiers. Generally, you should not extend this class yourself, but use Test::Roo to do so instead. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "description" .IX Subsection "description" A description for a subtest block wrapping all tests by the object. It is a \&'lazy' attribute. Test classes may implement their own \f(CW\*(C`_build_description\*(C'\fR method to create a description from object attributes. Otherwise, the default is \*(L"testing with \s-1CLASS\*(R".\s0 .SH "METHODS" .IX Header "METHODS" .SS "run_tests" .IX Subsection "run_tests" .Vb 5 \& # as a class method \& $class\->run_tests(); \& $class\->run_tests($description); \& $class\->run_tests($init_args); \& $class\->run_tests($description $init_args); \& \& # as an object method \& $self\->run_tests(); \& $self\->run_tests($description); .Ve .PP If called as a class method, this creates a test object using an optional hash reference of initialization arguments. .PP When called as an object method, or after an object has been generated, this method sets an optional description and runs tests. It will call the \f(CW\*(C`setup\*(C'\fR method (triggering any method modifiers), will run all tests (triggering any method modifiers on \f(CW\*(C`each_test\*(C'\fR) and will call the \f(CW\*(C`teardown\*(C'\fR method (triggering any method modifiers). .PP If a description is provided, it will override any initialized or generated \&\f(CW\*(C`description\*(C'\fR attribute. .PP The setup, tests and teardown will be executed in a Test::More subtest block. .SS "setup" .IX Subsection "setup" This is an empty method used to anchor method modifiers. It should not be overridden by subclasses. .SS "each_test" .IX Subsection "each_test" This method wraps the code references set by the \f(CW\*(C`test\*(C'\fR function from Test::Roo or Test::Roo::Role in a Test::More subtest block. .PP It may also be used to anchor modifiers that should run before or after each test block, though this can lead to brittle design as modifiers will globally affect every test block, including composed ones. .SS "teardown" .IX Subsection "teardown" This is an empty method used to anchor method modifiers. It should not be overridden by subclasses. .SH "AUTHOR" .IX Header "AUTHOR" David Golden .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2013 by David Golden. .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve