NAME
Fennec::Recipe::CustomFennec - Recipe for a custom Fennec module.
DESCRIPTION
Fennec autmatically loads several utlities for you. In addition it assumes you want to use Test::Builder through Fennec::Runner. Subclassing Fennec will let you specify exactly what utilities you want, and under whuch runner tests should be run. This way you can use your subclass in each test file instead of copying use Fennec => YOUR CONFIG OPTIONS
into each file.
THE RECIPE
package My::Fennec;
use strict;
use warnings;
use base 'Fennec';
sub defaults {
my $class = shift;
# If you want to add on to fennec's utils, instead of replacing them.
my %fennec_defaults = $class->SUPER::defaults;
return (
%fennec_defaults,
utils => [ ... ],
parallel => 3,
runner_class => 'Fennec::Runner',
with_tests => [],
...
);
}
sub init {
my $class = shift;
# If you are planning to still use Test::Builder then you should call
# SUPER::init. If you plan to use something else there is no need.
$class->SUPER::init( @_ );
# Recipe for typically desired information.
my %params = @_;
my $importer = $params{caller}->[0];
my $meta = $params{meta};
...
}