X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F1-validate.t;h=8fedbd98a3973488f579c7911187325d9b1fc04f;hb=5f5d44c525baf7d887f809f4281f208da33ac846;hp=8b62d47c2f4e94323880b590e0b6650f90fd1afd;hpb=e1fc1194a5bd198e9464d59bc948a2cbaaa00e21;p=webpac2 diff --git a/t/1-validate.t b/t/1-validate.t index 8b62d47..8fedbd9 100755 --- a/t/1-validate.t +++ b/t/1-validate.t @@ -1,31 +1,22 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 54; -use Test::Exception; use blib; -use Data::Dump qw/dump/; -use Cwd qw/abs_path/; +use Test::More tests => 54; BEGIN { +use_ok( 'WebPAC::Test' ); use_ok( 'WebPAC::Validate' ); } -my $debug = shift @ARGV; - -ok(my $abs_path = abs_path($0), "abs_path"); -$abs_path =~ s#/[^/]*$#/#; - -ok(my $v = new WebPAC::Validate( - debug => $debug, -), "new witout path"); +ok(my $v = new WebPAC::Validate(%LOG), "new witout path"); ok( ! $v->{rules}, 'no path' ); -ok(my $v = new WebPAC::Validate( +ok($v = new WebPAC::Validate( path => "$abs_path/data/validate_test", - debug => $debug, + %LOG, ), "new with path"); ok($v->{rules}, "rules exist"); @@ -89,7 +80,7 @@ sub test_v { if (ref($tmp) eq 'HASH') { return $tmp; } else { - diag "explanation: $tmp"; + diag "explanation: $tmp" if $debug; } } } else {