--- trunk/t/1-validate.t 2007/05/27 10:50:37 849 +++ trunk/t/1-validate.t 2007/05/27 17:09:47 858 @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 47; +use Test::More tests => 51; use Test::Exception; use blib; @@ -17,12 +17,24 @@ ok(my $abs_path = abs_path($0), "abs_path"); $abs_path =~ s#/[^/]*$#/#; -throws_ok { new WebPAC::Validate( no_log => 1 ) } qr/need path/, "new without path"; - ok(my $v = new WebPAC::Validate( - path => "$abs_path/data/validate_test", + path => "$abs_path/data/validate_test_simple", + debug => $debug, +), "new with path"); + +ok($v->{rules}, "rules exist"); + +is_deeply( $v->{rules}, { + '900' => [ 'a', 'b', 'c', 'd' ], +}, 'simple rules parsed'); + +ok($v = new WebPAC::Validate( debug => $debug, -), "new"); +), "new witout path"); + +ok( ! $v->{rules}, 'no path' ); + +ok( $v->read_validate_file( "$abs_path/data/validate_test" ), "read_validate_file" ); ok($v->{rules}, "rules exist"); @@ -36,7 +48,6 @@ }, 'rules parsed'); - throws_ok { $v->validate_rec() } qr/rec/, "validate_rec need rec"; sub test_v {