4 use Test::More tests => 8;
8 use Data::Dump qw/dump/;
10 use YAML qw/LoadFile/;
13 use_ok( 'WebPAC::Parser' );
14 use_ok( 'WebPAC::Config' );
17 my $debug = shift @ARGV;
19 ok(my $abs_path = abs_path($0), "abs_path");
20 $abs_path =~ s#/[^/]*$#/#;
22 my $config_path = "$abs_path/conf/test.yml";
24 ok(-e $config_path, "$config_path exists");
26 throws_ok { new WebPAC::Parser( no_log => 1 ) } qr/WebPAC::Config/, "new without config";
29 my $parser = new WebPAC::Parser(
30 config => new WebPAC::Config( path => $config_path ),
31 base_path => $abs_path,
35 ok($parser->{source}, "source exist");
37 ok($parser->parse, 'parse');