test fix
This commit is contained in:
10
t/render.t
10
t/render.t
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user