Test::TT - Test::More-style wrapper around Template
Version 0.01
use Test::Template tests => 1; my $table = build_display_table(); html_ok( $table, 'Built display table properly' );
This module provides a few convenience methods for testing exception based code. It is built with Test::Builder and plays happily with Test::More.
tt_ok
Checks to see that $tt_data is valid TT.
$tt_data
Checks to see if $tt_data is valid TT. $tt_data being blank is OK. $tt_data being undef is not. $tt_data will be passed directly to Template Toolkit, so you should pass a filename, a text reference or a file handle (GLOB).
If you pass a Template object, (<tt_ok()> will use that for parsing.
$vars will be passed to the template object, and should be a hashref. Can be skipped.
$vars
$output will be passed to the template object, and specifies what to the do with the output. If not present tt_ok will silently eat all the output.
$output
Please report any bugs to (patches welcome):
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install-Debian
Template
Thanks to chromatic and Michael G Schwern for the excellent Test::Builder.
Thanks to Andy Wardley for Template Toolkit.
Thanks to Adrian Howard for writing Test::Exception, from which most of this module is taken.
Bjørn-Olav Strand <bo@startsiden.no>
Copyright 2009 by Bjørn-Olav Strand <bo@startsiden.no>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Please note that these modules are not products of or supported by the employers of the various contributors to the code.
To install Test::TT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::TT
CPAN shell
perl -MCPAN -e shell install Test::TT
For more information on module installation, please visit the detailed CPAN module installation guide.