/[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 949 - (show annotations)
Thu Nov 1 00:16:48 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: application/x-troff
File size: 762 byte(s)
 r1433@llin:  dpavlin | 2007-10-31 22:48:02 +0100
 HUGE swiping changes to implement new testing architecture
 based on all new WebPAC::Test module which makes
 test writing a joy

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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26