/[webpac2]/trunk/t/5-output-tt.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/5-output-tt.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1256 - (hide annotations)
Tue Jul 28 12:40:46 2009 UTC (14 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 767 byte(s)
use code from lib insted of blib

1 dpavlin 16 #!/usr/bin/perl -w
2    
3 dpavlin 949 use strict;
4 dpavlin 1256 use lib 'lib';
5 dpavlin 16
6 dpavlin 949 use Test::More tests => 5;
7    
8 dpavlin 16 BEGIN {
9 dpavlin 949 use_ok( 'WebPAC::Test' );
10 dpavlin 16 use_ok( 'WebPAC::Output::TT' );
11     }
12    
13     ok(my $tt = new WebPAC::Output::TT(
14     include_path => "$abs_path../conf/output/tt",
15 dpavlin 949 %LOG
16 dpavlin 31 ), "new");
17 dpavlin 16
18 dpavlin 70 my $ds = {
19     'Source' => {
20     'name' => 'Izvor: ',
21     'tag' => 'Source',
22     'display' => [ 'foo' ]
23     },
24     'ID' => {
25     'name' => 'ID',
26     'tag' => 'IDths',
27 dpavlin 212 'search' => [ 'bar' ],
28 dpavlin 70 'lookup_key' => [ 'bar' ]
29     },
30 dpavlin 16 'filename' => [ 'out/thes/001.html' ],
31     'name' => 'filename',
32     'tag' => 'filename'
33 dpavlin 70 };
34 dpavlin 16
35     throws_ok { $tt->apply( template => 'foo', data => [] ) } qr/error.*foo/, "apply without template";
36    
37 dpavlin 70 cmp_ok(my $text = $tt->apply( template => 'text.tt', data => $ds ), '=~', qr/Source.*foo/, "apply");
38 dpavlin 16
39 dpavlin 949 diag $text if $debug;
40 dpavlin 16

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26