Test::C2FIT::ColumnFixture - A ColumnFixture maps columns in the test data to fields or methods of its subclasses.
Normally, you subclass ColumnFixture.
package MyColumnFixture; use base 'Test::C2FIT::ColumnFixture;' sub getX { my $self = shift; return $self->{X}; }
Column headings with braces (e.g. getX()) will get bound to methods, i.e. the data entered in your document will be checked against the result of the respective method. A Column heading consisting of more words will be concatened to a camel-case name ("get name ()" will be mapped to "getName()")
Column headings without braces 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}. A Column heading consisting of more words will be concatened to a camel-case name ("given name" will be mapped to "givenName")
$self->{surname}
When your data is not stored as string, then you'll propably need an TypeAdapter. See more in Fixture.
Will be called before a row gets processed
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.
Extensive and up-to-date documentation on FIT can be found at: http://fit.c2.com/
To install Test::C2FIT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::C2FIT
CPAN shell
perl -MCPAN -e shell install Test::C2FIT
For more information on module installation, please visit the detailed CPAN module installation guide.