X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F2-parse.t;h=8f1f334e1426eb175cfaf834dd319648c840f8ec;hb=5f5d44c525baf7d887f809f4281f208da33ac846;hp=36f4da2fee87317aacd2855ef0bf060a32402851;hpb=1a3c0ce2dbb6f20f224e215b4ed5715930921390;p=webpac2 diff --git a/t/2-parse.t b/t/2-parse.t index 36f4da2..8f1f334 100755 --- a/t/2-parse.t +++ b/t/2-parse.t @@ -1,35 +1,29 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 55; -use Test::Exception; use blib; -use Data::Dump qw/dump/; -use Cwd qw/abs_path/; +use Test::More tests => 55; + use YAML qw/LoadFile/; BEGIN { +use_ok( 'WebPAC::Test' ); use_ok( 'WebPAC::Parser' ); use_ok( 'WebPAC::Config' ); } -my $debug = shift @ARGV; - -ok(my $abs_path = abs_path($0), "abs_path"); -$abs_path =~ s#/[^/]*$#/#; - my $config_path = "$abs_path/conf/test.yml"; ok(-e $config_path, "$config_path exists"); -throws_ok { new WebPAC::Parser( no_log => 1 ) } qr/WebPAC::Config/, "new without config"; +throws_ok { new WebPAC::Parser( %LOG ) } qr/WebPAC::Config/, "new without config"; ok( my $parser = new WebPAC::Parser( config => new WebPAC::Config( path => $config_path ), base_path => $abs_path, - debug => $debug, + %LOG ), "new"); my $inputs = { @@ -120,7 +114,7 @@ ok( my $parser = new WebPAC::Parser( config => new WebPAC::Config( path => $config_path ), base_path => $abs_path, - debug => $debug, + %LOG, ), "new"); ok(my $marc = $parser->have_rules('marc', 'marc', 'marc-input'), 'have_rules(marc,...)');