--- trunk/t/6-unit.t 2005/07/24 15:35:46 33 +++ trunk/t/6-unit.t 2006/01/08 20:27:21 366 @@ -11,8 +11,8 @@ BEGIN { use_ok( 'WebPAC::Lookup' ); -use_ok( 'WebPAC::Input::ISIS' ); -use_ok( 'WebPAC::DB' ); +use_ok( 'WebPAC::Input' ); +use_ok( 'WebPAC::Store' ); use_ok( 'WebPAC::Normalize::XML' ); use_ok( 'WebPAC::Output::TT' ); } @@ -30,21 +30,24 @@ lookup_file => "$abs_path../conf/lookup/isis.pm", ), "new Lookup"); -ok(my $isis = new WebPAC::Input::ISIS( +ok(my $isis = new WebPAC::Input( + module => 'WebPAC::Input::ISIS', code_page => 'ISO-8859-2', # application encoding - limit_mfn => 10, + limit => 10, ), "new Input::ISIS"); ok(my $maxmfn = $isis->open( - filename => $isis_file, + path => $isis_file, code_page => '852', # database encoding + lookup => $lookup, ), "Input::ISIS->open"); ok(my $path = tempdir( CLEANUP => 1 ), "path"); -ok(my $db = new WebPAC::DB( +ok(my $db = new WebPAC::Store( path => $path, -), "new DB"); + database => '.', +), "new Store"); ok(my $n = new WebPAC::Normalize::XML( # filter => { 'foo' => sub { shift } }, @@ -55,7 +58,7 @@ ok($n->open( tag => 'isis', - xml_file => "$abs_path../conf/normalize/isis.xml", + xml_file => "$abs_path/data/normalize.xml", ), "Normalize::XML->open"); ok(my $out = new WebPAC::Output::TT( @@ -65,17 +68,17 @@ while (my $row = $isis->fetch) { - ok(my @ds = $n->data_structure($row), "data_structure"); + ok(my $ds = $n->data_structure($row), "data_structure"); -# diag Dumper(\@ds); +# diag Dumper($ds); ok(my $html = $out->apply( template => 'html.tt', - data => \@ds, + data => $ds, ), "apply"); $html =~ s#\s*[\n\r]+\s*##gs; - diag $html; + #diag $html; };