equal
deleted
inserted
replaced
5 use Test::More; |
5 use Test::More; |
6 use Pod::Coverage; |
6 use Pod::Coverage; |
7 use File::Temp; |
7 use File::Temp; |
8 |
8 |
9 BEGIN { |
9 BEGIN { |
10 use_ok "DNStools::Config", "get_config"; |
10 use_ok "DNStools::Config" => qw(get_config); |
11 } |
11 } |
12 |
12 |
13 can_ok("DNStools::Config" => "get_config"); |
13 can_ok("DNStools::Config" => "get_config"); |
14 |
14 |
15 eval { get_config("xxx|xxx", "yyy|yyy") }; |
15 eval { get_config("xxx|xxx", "yyy|yyy") }; |
35 |
35 |
36 # it should find the file specified in $ENV{DNSTOOLS_CONF} |
36 # it should find the file specified in $ENV{DNSTOOLS_CONF} |
37 $ENV{DNSTOOLS_CONF} = $tmp->filename; |
37 $ENV{DNSTOOLS_CONF} = $tmp->filename; |
38 %cf = (); |
38 %cf = (); |
39 %cf = get_config("xxx|xxx", $tmp->filename); |
39 %cf = get_config("xxx|xxx", $tmp->filename); |
40 ok(%cf, "got config from env"); |
40 ok(%cf, "got config from \$DNSTOOLS_CONF"); |
41 is($cf{abc} => "xyz", "simple value"); |
41 is($cf{abc} => "xyz", "simple value"); |
42 is($cf{other} => "valuewithspace", "spaced value"); |
42 is($cf{other} => "valuewithspace", "spaced value"); |
43 |
43 |
44 |
44 |
45 done_testing(); |
45 done_testing(); |