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 |
} |
} |
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"); |
database => '.', |
48 |
|
), "new Store"); |
49 |
|
|
50 |
ok(my $n = new WebPAC::Normalize::XML( |
ok(my $n = new WebPAC::Normalize::XML( |
51 |
# filter => { 'foo' => sub { shift } }, |
# filter => { 'foo' => sub { shift } }, |
66 |
|
|
67 |
while (my $row = $isis->fetch) { |
while (my $row = $isis->fetch) { |
68 |
|
|
69 |
ok(my @ds = $n->data_structure($row), "data_structure"); |
ok(my $ds = $n->data_structure($row), "data_structure"); |
70 |
|
|
71 |
# diag Dumper(\@ds); |
# diag Dumper($ds); |
72 |
|
|
73 |
ok(my $html = $out->apply( |
ok(my $html = $out->apply( |
74 |
template => 'html.tt', |
template => 'html.tt', |
75 |
data => \@ds, |
data => $ds, |
76 |
), "apply"); |
), "apply"); |
77 |
|
|
78 |
$html =~ s#\s*[\n\r]+\s*##gs; |
$html =~ s#\s*[\n\r]+\s*##gs; |