.\" 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::FITesque::Fixture 3pm" .TH Test::FITesque::Fixture 3pm "2021-01-22" "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::FITesque::Fixture \- Abstract calls for fixtures .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& package Buddha::Fixture; \& \& use strict; \& use warnings; \& use base qw(Test::FITesque::Fixture); \& use Test::More qw(); \& \& sub click_on_button : Test { \& my ($self, @args) = @_; \& ... \& ok(1); \& } \& \& sub open_window : Test : Plan(3) { \& my ($self, @args) = @_; \& ... \& ok(1); \& ok(2); \& ok(3); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides the base class for FITesque fixtures. It provides methods for the 'Test' and 'Plan' attributes along with some utility functions for Test::FITesque::Fixture. .PP All methods for use as FITesque test methods must be marked with the 'Test' attribute. .PP The 'Plan' attribute states how many Test::More functions the FITesque test method expects to run. If a method does not have the 'Plan' attribute set, it is implied that the test method will execute one Test::More functions. .PP .Vb 4 \& # Execute 10 Test::More functions \& sub test_method : Test : Plan(10) { \& ... \& } \& \& # Just one this time \& sub test_method : Test { \& ... \& } \& \& # not a test method \& sub normal_method { \& ... \& } .Ve .PP There are also 2 methods which may require overriding. The parse_method_string method returns a coderef of the method that relates to the method string used as the first element of a FITesque test row. .PP .Vb 2 \& # get coderef for the \*(Aqclick_on_buton\*(Aq method of the fixture class \& my $coderef = $fixture\->parse_method_string(\*(Aqclick on button\*(Aq); .Ve .PP The other method, 'parse_arguments' provides a hook in point to allow preprocessing on arguments to FITesque fixture test methods. This might be useful in case you want to design a domain specific language into your arguments. By default, this method just returns the arguments as is. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& my $fixture = Buddha::Fixture\->new(); .Ve .PP Simple constructor .SS "method_test_count" .IX Subsection "method_test_count" .Vb 1 \& my $count = $fixture\->method_test_count(\*(Aqfoo\*(Aq); .Ve .PP This returns the planned test count associated with the passed method name. .SS "parse_method_string" .IX Subsection "parse_method_string" .Vb 1 \& my $coderef = $fixture\->parse_method_string(\*(Aqclick on button\*(Aq); .Ve .PP This method takes a string of text and attempts to return a coderef of a method within the fixture class. .SS "parse_arguments" .IX Subsection "parse_arguments" .Vb 1 \& my @arguments = $fixture\->parse_arguments(qw(one two three)); .Ve .PP This method provides a way to preprocess arguments for methods before they are run. .SH "AUTHORS" .IX Header "AUTHORS" Scott McWhirter, \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2007 Scott McWhirter, all rights reserved. .PP This program is released under the following license: \s-1BSD.\s0 Please see the \&\s-1LICENSE\s0 file included in this distribution for details.