/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (show annotations)
Sun Jul 17 14:53:37 2005 UTC (18 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 849 byte(s)
first cut into WebPAC::DB

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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26