silence diag in test
[catagits/Catalyst-Devel.git] / t / back_compat.t
index f4179dc..f1cd584 100644 (file)
@@ -1,13 +1,11 @@
 use strict;
 use warnings;
-use FindBin qw/$Bin/;
 use File::Temp qw/tempfile/;
-use lib "$Bin/lib";
-use Data::Dumper;
+use lib "t/lib";
 
 use MyTestHelper;
 
-use Test::More tests => 3;
+use Test::More;
 
 my $helper = bless {}, 'MyTestHelper';
 
@@ -21,13 +19,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;