1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
|
use Test::More tests => 5; |
|
|
use Test::Exception; |
|
|
use Cwd qw/abs_path/; |
|
|
use blib; |
|
3 |
use strict; |
use strict; |
4 |
|
use blib; |
5 |
|
|
6 |
|
use Test::More tests => 5; |
7 |
|
|
8 |
BEGIN { |
BEGIN { |
9 |
|
use_ok( 'WebPAC::Test' ); |
10 |
use_ok( 'WebPAC::Output::TT' ); |
use_ok( 'WebPAC::Output::TT' ); |
11 |
} |
} |
12 |
|
|
|
ok(my $abs_path = abs_path($0), "abs_path"); |
|
|
$abs_path =~ s#/[^/]*$#/#; |
|
|
diag "abs_path: $abs_path"; |
|
|
|
|
13 |
ok(my $tt = new WebPAC::Output::TT( |
ok(my $tt = new WebPAC::Output::TT( |
14 |
include_path => "$abs_path../conf/output/tt", |
include_path => "$abs_path../conf/output/tt", |
15 |
no_log => 1, |
%LOG |
16 |
), "new"); |
), "new"); |
17 |
|
|
18 |
my $ds = { |
my $ds = { |
36 |
|
|
37 |
cmp_ok(my $text = $tt->apply( template => 'text.tt', data => $ds ), '=~', qr/Source.*foo/, "apply"); |
cmp_ok(my $text = $tt->apply( template => 'text.tt', data => $ds ), '=~', qr/Source.*foo/, "apply"); |
38 |
|
|
39 |
diag $text; |
diag $text if $debug; |
40 |
|
|