/[webpac2]/trunk/t/6-unit.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

Diff of /trunk/t/6-unit.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by dpavlin, Sun Jul 24 15:03:11 2005 UTC revision 209 by dpavlin, Mon Dec 5 17:46:57 2005 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 23;  use Test::More tests => 34;
6  use Test::Exception;  use Test::Exception;
7  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
8  use File::Temp qw/tempdir/;  use File::Temp qw/tempdir/;
9    use Data::Dumper;
10  use blib;  use blib;
11    
12  BEGIN {  BEGIN {
13  use_ok( 'WebPAC::Lookup' );  use_ok( 'WebPAC::Lookup' );
14  use_ok( 'WebPAC::Input::ISIS' );  use_ok( 'WebPAC::Input::ISIS' );
15  use_ok( 'WebPAC::DB' );  use_ok( 'WebPAC::Store' );
16  use_ok( 'WebPAC::Normalize::XML' );  use_ok( 'WebPAC::Normalize::XML' );
17  use_ok( 'WebPAC::Output::TT' );  use_ok( 'WebPAC::Output::TT' );
18  }  }
# Line 41  ok(my $maxmfn = $isis->open( Line 42  ok(my $maxmfn = $isis->open(
42    
43  ok(my $path = tempdir( CLEANUP => 1 ), "path");  ok(my $path = tempdir( CLEANUP => 1 ), "path");
44    
45  ok(my $db = new WebPAC::DB(  ok(my $db = new WebPAC::Store(
46          path => $path,          path => $path,
47  ), "new DB");  ), "new Store");
48    
49  ok(my $n = new WebPAC::Normalize::XML(  ok(my $n = new WebPAC::Normalize::XML(
50  #       filter => { 'foo' => sub { shift } },  #       filter => { 'foo' => sub { shift } },
# Line 64  ok(my $out = new WebPAC::Output::TT( Line 65  ok(my $out = new WebPAC::Output::TT(
65    
66  while (my $row = $isis->fetch) {  while (my $row = $isis->fetch) {
67                    
68          ok(my @ds = $n->data_structure($row), "data_structure");          ok(my $ds = $n->data_structure($row), "data_structure");
69    
70  use Data::Dumper;  #       diag Dumper($ds);
 print Dumper(\@ds);  
71    
72          ok($out->apply(          ok(my $html = $out->apply(
73                  template => 'html.tt',                  template => 'html.tt',
74                  data => @ds,                  data => $ds,
75          ), "apply");          ), "apply");
76    
77            $html =~ s#\s*[\n\r]+\s*##gs;
78    
79            diag $html;
80    
81  };  };

Legend:
Removed from v.31  
changed lines
  Added in v.209

  ViewVC Help
Powered by ViewVC 1.1.26