X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F5-output-tt.t;h=5342e169f7ab5f7c08a3d1582e00a668c8b1f5c9;hb=HEAD;hp=b645630e7fa71b923c17852dd439862a396fd6b2;hpb=4e9c568b879ad1689ed10b4196db5f2fb270255e;p=webpac2 diff --git a/t/5-output-tt.t b/t/5-output-tt.t index b645630..5342e16 100755 --- a/t/5-output-tt.t +++ b/t/5-output-tt.t @@ -1,22 +1,18 @@ #!/usr/bin/perl -w -use Test::More tests => 5; -use Test::Exception; -use Cwd qw/abs_path/; -use blib; use strict; +use lib 'lib'; + +use Test::More tests => 5; BEGIN { +use_ok( 'WebPAC::Test' ); use_ok( 'WebPAC::Output::TT' ); } -ok(my $abs_path = abs_path($0), "abs_path"); -$abs_path =~ s#/[^/]*$#/#; -diag "abs_path: $abs_path"; - ok(my $tt = new WebPAC::Output::TT( include_path => "$abs_path../conf/output/tt", - no_log => 1, + %LOG ), "new"); my $ds = { @@ -28,7 +24,7 @@ my $ds = { 'ID' => { 'name' => 'ID', 'tag' => 'IDths', - 'swish' => [ 'bar' ], + 'search' => [ 'bar' ], 'lookup_key' => [ 'bar' ] }, 'filename' => [ 'out/thes/001.html' ], @@ -40,5 +36,5 @@ throws_ok { $tt->apply( template => 'foo', data => [] ) } qr/error.*foo/, "apply cmp_ok(my $text = $tt->apply( template => 'text.tt', data => $ds ), '=~', qr/Source.*foo/, "apply"); -diag $text; +diag $text if $debug;