Keep plugin in sync with mojo project
- Add test template with new naming schema Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
This commit is contained in:
committed by
Ask Bjørn Hansen
parent
68438d57cb
commit
d7726cfa0e
+17
-7
@@ -3,27 +3,37 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 6;
|
||||
|
||||
use Mojo::Transaction;
|
||||
use MojoX::Context;
|
||||
use Mojolicious;
|
||||
use Mojolicious::Controller;
|
||||
use MojoX::Renderer;
|
||||
|
||||
use_ok('MojoX::Renderer::TT');
|
||||
|
||||
my $c = MojoX::Context->new;
|
||||
my $c = Mojolicious::Controller->new(app => Mojolicious->new);
|
||||
$c->app->log->path(undef);
|
||||
$c->app->log->level('fatal');
|
||||
|
||||
my $mt = MojoX::Renderer::TT->build;
|
||||
|
||||
my $output;
|
||||
my $rv;
|
||||
|
||||
$c->stash->{template} = 't/render/template.tt2';
|
||||
|
||||
$c->stash->{template_path} = 't/render/template.tt2';
|
||||
$rv = $mt->(undef, $c, \$output);
|
||||
is($rv, 1);
|
||||
is($output, "4\n");
|
||||
|
||||
$c->stash->{template} = 't/render/error.tt2';
|
||||
$c->stash->{template_path} = 't/render/error.tt2';
|
||||
$rv = $mt->(undef, $c, \$output);
|
||||
is($rv, 0);
|
||||
ok($output);
|
||||
|
||||
delete $c->stash->{template_path};
|
||||
|
||||
$c->app->renderer->root('./')->add_handler(tt2 => $mt);
|
||||
|
||||
is($c->render('t/render/template','partial' => 1,handler => 'tt2'),"4\n");
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
[% 2 + 2 %]
|
||||
Reference in New Issue
Block a user