diff -r a3860111db49 -r 3db363880766 t/00-config.t --- a/t/00-config.t Thu Jun 30 15:19:33 2011 +0200 +++ b/t/00-config.t Thu Jun 30 16:24:32 2011 +0200 @@ -10,12 +10,12 @@ use_ok "DNStools::Config" => qw(get_config); } -can_ok("DNStools::Config" => "get_config"); +can_ok( "DNStools::Config" => "get_config" ); -eval { get_config("xxx|xxx", "yyy|yyy") }; -ok($@, "dies on missing config"); +eval { get_config( "xxx|xxx", "yyy|yyy" ) }; +ok( $@, "dies on missing config" ); -my ($tmp, %cf); +my ( $tmp, %cf ); # prepare some simple sample config my $c = <filename); -ok(%cf, "got config"); -is($cf{abc} => "xyz", "simple value"); -is($cf{other} => "valuewithspace", "spaced value"); +%cf = get_config( "xxx|xxx", $tmp->filename ); +ok( %cf, "got config" ); +is( $cf{abc} => "xyz", "simple value" ); +is( $cf{other} => "valuewithspace", "spaced value" ); # it should find the file specified in $ENV{DNSTOOLS_CONF} $ENV{DNSTOOLS_CONF} = $tmp->filename; -%cf = (); -%cf = get_config(); -ok(%cf, "got config from \$DNSTOOLS_CONF"); -is($cf{abc} => "xyz", "simple value"); -is($cf{other} => "valuewithspace", "spaced value"); +%cf = (); +%cf = get_config(); +ok( %cf, "got config from \$DNSTOOLS_CONF" ); +is( $cf{abc} => "xyz", "simple value" ); +is( $cf{other} => "valuewithspace", "spaced value" );