--- a/t/00-config.t Wed Jun 29 10:33:32 2011 +0200
+++ b/t/00-config.t Wed Jun 29 11:42:51 2011 +0200
@@ -2,8 +2,9 @@
use strict;
use warnings;
+use lib 't/lib';
use Test::More qw(no_plan);
-use File::Temp;
+use Aux;
BEGIN {
use_ok "DNStools::Config" => qw(get_config);
@@ -17,12 +18,12 @@
my ($tmp, %cf);
# prepare some simple sample config
-$tmp = File::Temp->new();
-print {$tmp} <<__EOF;
+my $c = <<EOF;
# comment
abc = xyz
other = value with space
-__EOF
+EOF
+$tmp = Aux::make_config $c;
close($tmp);
# the files is specified, it should find the first
@@ -35,7 +36,7 @@
# it should find the file specified in $ENV{DNSTOOLS_CONF}
$ENV{DNSTOOLS_CONF} = $tmp->filename;
%cf = ();
-%cf = get_config("xxx|xxx", $tmp->filename);
+%cf = get_config();
ok(%cf, "got config from \$DNSTOOLS_CONF");
is($cf{abc} => "xyz", "simple value");
is($cf{other} => "valuewithspace", "spaced value");