X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fback_compat.t;h=0937babc088578f12ccad00b81cc2fee5ff7614b;hb=40b26f8b57aee03596ea12cfd45e45a29a5cc80a;hp=f4179dc3bd2a43673228628ffc4d1695a6a6649e;hpb=7025ed899fbbf9d2bac50f85943d66e79d448b8d;p=catagits%2FCatalyst-Devel.git diff --git a/t/back_compat.t b/t/back_compat.t index f4179dc..0937bab 100644 --- a/t/back_compat.t +++ b/t/back_compat.t @@ -3,11 +3,10 @@ use warnings; use FindBin qw/$Bin/; use File::Temp qw/tempfile/; use lib "$Bin/lib"; -use Data::Dumper; use MyTestHelper; -use Test::More tests => 3; +use Test::More; my $helper = bless {}, 'MyTestHelper'; @@ -21,13 +20,21 @@ chomp $example2; is $example1, 'foobar[% test_var %]'; is $example2, 'bazquux'; -my ($fh, $fn) = tempfile; -$helper->render_file($fn, { test_var => 'test_val' }); -seek $fh, 0, 0; # Rewind +package MyTestHelper; + +use Test::More; +use File::Temp qw/tempfile/; + +my ($fh, $fn) = tempfile( UNLINK => 1 ); +close $fh; +$helper->render_file('example1', $fn, { test_var => 'test_val' }); +open $fh, $fn or die $@; +#seek $fh, 0, 0; # Rewind my $contents; { local $/; $contents = <$fh>; } -warn $contents; -is $contents, 'foobartest_val'; +is $contents, "foobartest_val\n"; + +done_testing;