Test::System::Output::Factory - Factory class for building TAP formatters


Test-System documentation Contained in the Test-System distribution.

Index


Code Index:

NAME

Top

Test::System::Output::Factory - Factory class for building TAP formatters

DESCRIPTION

Top

This module is part of Test::System and is used as a factory class for the TAP formats.

Usually this module gets called directly by Test::System but if you want to create the instance, modify it and then pass it to Test::System.

SYNOPSIS

Top

    use Test::System::Output::Factory;

    my $formatter = Test::System::Output::Factory->new('html');
    $formatter->do_your_stuff();

Available formatters

Top

* html

Returns a TAP::Formatter::HTML instance

* console

Returns a TAP::Formatter::Console instance

AUTHOR

Top

Pablo Fischer, pablo@pablo.com.mx.

COPYRIGHT

Top


Test-System documentation Contained in the Test-System distribution.
#
# Test::System::Output::Factory
#
# Author(s): Pablo Fischer (pfischer@cpan.org)
# Created: 11/08/2009 15:20:11 PST 15:20:11
package Test::System::Output::Factory;

use strict;
use warnings;
use Class::Factory;
use base qw(Class::Factory);

our $VERSION = '0.03';

sub new {
    my ($pkg, $type, @params) = @_;
    my $class = $pkg->get_factory_class($type);
    return undef unless ($class);
    my $self = "$class"->new(@params);
    return $self;
}

__PACKAGE__->register_factory_type(html => 'TAP::Formatter::HTML');
__PACKAGE__->register_factory_type(console => 'TAP::Formatter::Console');

1;