4 |
use strict; |
use strict; |
5 |
use autodie; |
use autodie; |
6 |
|
|
7 |
use Test::More tests => 3; |
use Test::More tests => 4; |
8 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
9 |
|
|
10 |
use_ok 'config'; |
use_ok 'config'; |
11 |
|
|
12 |
ok( my $test = config::shared( 'test', 42 ), 'set shared' ); |
sub test { |
13 |
diag $test; |
my $name = shift; |
14 |
cmp_ok( $test, '==', config::shared( 'test' ), 'get shared' ); |
my $eval = qq|config::$name( "172.0.0.1" );|; |
15 |
|
diag "eval $eval"; |
16 |
|
my $config = eval $eval; |
17 |
|
die $@ if $@; |
18 |
|
return $config; |
19 |
|
} |
20 |
|
|
21 |
|
foreach my $name ( 'webconverger', 'debian_live', 'nfsroot' ) { |
22 |
|
ok( my $config = test($name), $name ); |
23 |
|
diag "config", $config; |
24 |
|
} |