1 |
dpavlin |
681 |
#!/usr/bin/perl -w |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use Test::More tests => 8; |
5 |
|
|
use Test::Exception; |
6 |
|
|
use blib; |
7 |
|
|
|
8 |
|
|
use Data::Dump qw/dump/; |
9 |
|
|
use Cwd qw/abs_path/; |
10 |
|
|
|
11 |
|
|
BEGIN { |
12 |
|
|
use_ok( 'WebPAC::Config' ); |
13 |
|
|
} |
14 |
|
|
|
15 |
|
|
my $debug = shift @ARGV; |
16 |
|
|
|
17 |
|
|
ok(my $abs_path = abs_path($0), "abs_path"); |
18 |
|
|
$abs_path =~ s#/[^/]*$#/#; |
19 |
|
|
|
20 |
|
|
my $path = "$abs_path/conf/test.yml"; |
21 |
|
|
|
22 |
|
|
ok(my $c = new WebPAC::Config( path => $path ), "new"); |
23 |
|
|
|
24 |
|
|
cmp_ok($c->{path}, 'eq', $path, "path $path"); |
25 |
|
|
|
26 |
|
|
ok($c->{config}, "config exist"); |
27 |
|
|
|
28 |
|
|
isa_ok($c->databases, 'HASH', "databases"); |
29 |
|
|
|
30 |
|
|
my @names = $c->databases; |
31 |
|
|
|
32 |
|
|
isa_ok(\@names, 'ARRAY', "databases names"); |
33 |
|
|
|
34 |
|
|
cmp_ok(@names, '==', 3, "got 3 names"); |