1 |
dpavlin |
514 |
#!/usr/bin/perl -w |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use Test::More tests => 5; |
5 |
|
|
use Test::Exception; |
6 |
|
|
use blib; |
7 |
|
|
|
8 |
|
|
use Data::Dumper; |
9 |
|
|
use Cwd qw/abs_path/; |
10 |
|
|
|
11 |
|
|
BEGIN { |
12 |
|
|
use_ok( 'WebPAC::Validate' ); |
13 |
|
|
} |
14 |
|
|
|
15 |
|
|
my $debug = shift @ARGV; |
16 |
|
|
|
17 |
|
|
ok(my $abs_path = abs_path($0), "abs_path"); |
18 |
|
|
$abs_path =~ s#/[^/]*$#/#; |
19 |
|
|
|
20 |
|
|
throws_ok { new WebPAC::Validate( no_log => 1 ) } qr/need path/, "new without path"; |
21 |
|
|
|
22 |
|
|
ok(my $v = new WebPAC::Validate( |
23 |
|
|
path => "$abs_path/data/validate_test", |
24 |
|
|
), "new"); |
25 |
|
|
|
26 |
|
|
ok($v->{rules}, "rules exist"); |