4 use Test::More tests => 12;
9 my $file = 't/conf/conf.pl';
10 my $config = Config::Any::Perl->load( $file );
13 is( $config->{ name }, 'TestApp' );
15 my $config_load2 = Config::Any::Perl->load( $file );
16 is_deeply( $config_load2, $config, 'multiple loads of the same file' );
21 my $file = 't/invalid/conf.pl';
24 $config = Config::Any::Perl->load( $file );
28 ok !$loaded, 'config load failed';
29 is $config, undef, 'config load failed';
30 like $@, qr/syntax error/, 'error thrown';
33 # parse error generated on invalid config
35 my $file = 't/invalid/conf.pl';
38 $config = Config::Any::Perl->load( $file );
39 Config::Any->load_files( { files => [$file], use_ext => 1} );
43 ok !$loaded, 'config load failed';
44 is $config, undef, 'config load failed';
45 like $@, qr/syntax error/, 'error thrown';
50 my $file = 't/invalid/missing.pl';
53 $config = Config::Any::Perl->load( $file );
57 ok !$loaded, 'config load failed';
58 is $config, undef, 'config load failed';
59 like $@, qr/No such file or directory/, 'error thrown';