| Test-System documentation | Contained in the Test-System distribution. |
Test::System::Output::Factory - Factory class for building TAP formatters
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.
use Test::System::Output::Factory;
my $formatter = Test::System::Output::Factory->new('html');
$formatter->do_your_stuff();
htmlReturns a TAP::Formatter::HTML instance
consoleReturns a TAP::Formatter::Console instance
Pablo Fischer, pablo@pablo.com.mx.
Copyright (C) 2009 by Pablo Fischer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 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;