Permalink
Browse files

Fixes render_file failing to render the same file if called twice

  • Loading branch information...
1 parent 8a5af3b commit e5d286c95272b312b336dcbe01a00c3c147bc94f Carlos Lima committed Nov 30, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −1 lib/Text/Haml.pm
  2. +5 −1 t/render_file.t
View
@@ -1094,7 +1094,7 @@ sub _eq_mtime {
sub _interpret_cached {
my $self = shift;
- my $compiled = require $self->cache_path;
+ my $compiled = do $self->cache_path;
$self->compiled($compiled);
return $self->interpret(@_);
}
View
@@ -5,7 +5,7 @@ use warnings;
use Text::Haml;
-use Test::More tests => 6;
+use Test::More tests => 8;
use IO::File;
use URI::Escape ();
@@ -67,6 +67,10 @@ $haml = Text::Haml->new(
$output = $haml->render_file('render.haml', title => 'RENDER_FILE_TEST');
# same output test 1
is($output, $expected1);
+# rendering same file again works just the same
+$output = $haml->render_file('render.haml', title => 'RENDER_FILE_TEST');
+is($output, $expected1);
+is($haml->error,undef);
$haml = Text::Haml->new(
path => $tempdir,

0 comments on commit e5d286c

Please sign in to comment.