NAME

Test::TT - Test::More-style wrapper around Template

VERSION

Version 0.01

SYNOPSIS

use Test::Template tests => 1;

my $table = build_display_table();
html_ok( $table, 'Built display table properly' );

DESCRIPTION

This module provides a few convenience methods for testing exception based code. It is built with Test::Builder and plays happily with Test::More.

EXPORT

tt_ok

tt_ok( [$tt_options, ] $tt_data, $name, $vars, $output )

Checks to see that $tt_data is valid TT.

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.

$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.

BUGS

Please report any bugs to (patches welcome):

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install-Debian

SEE ALSO

Template

ACKNOWLEGEMENTS

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.

AUTHOR

Bjørn-Olav Strand <bo@startsiden.no>

LICENSE

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.