--- trunk/t/2-input.t 2007/10/30 01:46:41 909 +++ trunk/t/2-input.t 2007/11/01 00:16:48 949 @@ -1,31 +1,27 @@ #!/usr/bin/perl -w -use Test::More tests => 123; -use Test::Exception; -use Cwd qw/abs_path/; -use blib; use strict; +use blib; -use Data::Dump qw/dump/; +use Test::More tests => 124; BEGIN { +use_ok( 'WebPAC::Test' ); use_ok( 'WebPAC::Input::ISIS' ); use_ok( 'WebPAC::Input::MARC' ); use_ok( 'WebPAC::Input::Test' ); } -my $debug = shift @ARGV; -my $no_log = $debug ? 0 : 1; +$LOG{no_progress_bar} = 1; -ok(my $abs_path = abs_path($0), "abs_path"); -$abs_path =~ s#/[^/]*$#/#; #vim +warn "# LOG = ",dump( %LOG ); my $module = 'WebPAC::Input::ISIS'; diag "testing with $module"; -throws_ok { my $input = new WebPAC::Input( no_log => $no_log ) } qr/module/, "need module"; -ok(my $input = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1, stats => 1 ), "new $module"); -ok(my $input_lm = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1 ), "new $module"); +throws_ok { my $input = new WebPAC::Input( %LOG ) } qr/module/, "need module"; +ok(my $input = new WebPAC::Input( module => $module, stats => 1, \%LOG ), "new $module"); +ok(my $input_lm = new WebPAC::Input( module => $module, \%LOG ), "new $module"); throws_ok { $input->open( ) } qr/path/, "need path"; @@ -113,7 +109,7 @@ $module = 'WebPAC::Input::MARC'; diag "testing with $module"; -ok($input = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1, stats => 1 ), "new $module"); +ok($input = new WebPAC::Input( module => $module, stats => 1, %LOG ), "new $module"); ok($input->open( path => "$abs_path/data/marc.iso" ), "open marc.iso"); @@ -126,7 +122,7 @@ diag "stats:\n$s" if ($debug); # test modify_record $module = 'WebPAC::Input::Test'; -ok($input = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1, debug => $debug ), "new $module"); +ok($input = new WebPAC::Input( module => $module, %LOG ), "new $module"); $WebPAC::Input::Test::rec = { '200' => [