This commit is contained in:
vti
2008-12-09 11:21:51 +01:00
committed by Ask Bjørn Hansen
parent e3db05fcb6
commit e779579347

View File

@@ -6,18 +6,24 @@ use warnings;
use Test::More tests => 5;
use Mojo::Transaction;
use MojoX::Context;
use_ok('MojoX::Renderer::TT');
my $c = MojoX::Context->new;
my $mt = MojoX::Renderer::TT->build;
my $output;
my $rv;
$rv = $mt->(undef, { path => 't/render/template.tt2', output => \$output });
$c->stash->{template_path} = 't/render/template.tt2';
$rv = $mt->(undef, $c, \$output);
is($rv, 1);
is($output, "4\n");
$rv = $mt->(undef, { path => 't/render/template-error.tt2', output => \$output });
$c->stash->{template_path} = 't/render/error.tt2';
$rv = $mt->(undef, $c, \$output);
is($rv, 0);
ok($output);