#!/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");
if (ref($tmp) eq 'HASH') {
return $tmp;
} else {
- diag "explanation: $tmp";
+ diag "explanation: $tmp" if $debug;
}
}
} else {