NAME
Fennec::DeveloperManual::Files - Writing Custom File Loaders.
SYNOPSIS
package Fennec::FileType::MyType;
use strict;
use warnings;
use base 'Fennec::FileType';
sub valid_file {
my $class = shift;
my ( $file ) = @_;
...
return $bool;
}
sub load_file {
my $self = shift;
my $file = $self->filename;
...
return $package;
}
sub paths {qw( t/ ... )}
1;
METHODS
You must implement the following methods.
- $bool = $class->valid_file( $filename )
-
Return true if the given filename is a valid file of the type you expect.
- $package = $obj->load_file()
-
Must load the test file. This must also make sure that a package name is generated for the file. When finished the method must return the name of the package for the test file. This package must also be a subclass of Fennec::TestFile.
- @list = $obj->paths()
-
A list of paths, relative to the project root, in which to search for test files.
USER DOCUMENTATION
User documentation is for those who wish to use Fennec to write simple tests, or manage a test suite for a project.
DEVELOPER DOCUMENTATION
Developer documentation is for those who wish to extend Fennec, or contribute to overall Fennec development.
API DOCUMENTATION
API Documentation covers object internals. See the POD within each individual module.
AUTHORS
Chad Granum exodist7@gmail.com
COPYRIGHT
Copyright (C) 2010 Chad Granum
Fennec is free software; Standard perl licence.
Fennec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.