Skip to content

Commit

Permalink
Fix inline rendering and test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusramberg committed Jan 22, 2011
1 parent 26d5559 commit 01b8f94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/MojoX/Renderer/TT.pm
Expand Up @@ -52,11 +52,12 @@ sub _init {
return $self;
}

use Data::Dumper;
sub _render {
my ($self, $renderer, $c, $output, $options) = @_;

# Inline
my $inline = $c->{stash}->{inline};
my $inline = $options->{inline};

# Template
my $t = $renderer->template_name($options);
Expand Down
6 changes: 3 additions & 3 deletions t/lite_app.t
Expand Up @@ -34,7 +34,7 @@ get '/unknown_helper' => 'unknown_helper';

get '/on-disk' => 'foo';

get '/foo/:message' => 'index';
get '/bar/:message' => 'bar';

get '/inline' => sub { shift->render(inline => '[% 1 + 1 %]', handler => 'tt') };

Expand All @@ -44,7 +44,7 @@ my $t = Test::Mojo->new;
$t->get_ok('/exception')->status_is(500)->content_like(qr/error/i);

# Normal rendering
$t->get_ok('/foo/hello')->content_is("hello");
$t->get_ok('/bar/hello')->content_is("hello");

# With include
$t->get_ok('/with_include')->content_is("HelloInclude!Hallo");
Expand Down Expand Up @@ -75,7 +75,7 @@ $t->get_ok('/inline')->status_is(200)->content_is('2');

__DATA__
@@ index.html.tt
@@ bar.html.tt
[% message %]
@@ error.html.tt
Expand Down

0 comments on commit 01b8f94

Please sign in to comment.