The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Test::C2FIT::ColumnFixture - A ColumnFixture maps columns in the test data to fields or methods of its subclasses.

SYNOPSIS

Normally, you subclass ColumnFixture.

        package MyColumnFixture;
        use base 'Test::C2FIT::ColumnFixture;'

        sub getX {
         my $self = shift;
         return $self->{X};
        }

DESCRIPTION

Column headings with braces (e.g. getX()) or column names consisting of more words ("get name" will bound to methods, i.e. the data entered in your document will be checked against the result of the respective method. ("get name" will be mapped to "getName()")

Column headings without braces consisting of one word will be bound to instance variables (=fields). In perl these need not to be predeclared. E.g. when column heading is "surname", then the ColumnFixture puts the text of the respective cell to a variable which can be used by $self-{surname}>.

When your data is not stored as string, then you'll propably need an TypeAdapter. See more in Fixture.

METHODS

reset()

Will be called before a row gets processed

execute()

Will be called either after a row has been processed or before the first usage of a method-column in the row, depending upon which case occurs first.

SEE ALSO

Extensive and up-to-date documentation on FIT can be found at: http://fit.c2.com/