added a flatten_to_hash option to return a simple key-value hashref instead of the...
[p5sagit/Config-Any.git] / t / 54-xml.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Config::Any::XML;
6
7 if ( !Config::Any::XML->is_supported ) {
8     plan skip_all => 'XML format not supported';
9 }
10 else {
11     plan tests => 4;
12 }
13
14 {
15     my $config = Config::Any::XML->load( 't/conf/conf.xml' );
16     ok( $config );
17     is( $config->{ name }, 'TestApp' );
18 }
19
20 # test invalid config
21 {
22     my $file   = 't/invalid/conf.xml';
23     my $config = eval { Config::Any::XML->load( $file ) };
24
25     ok( !$config, 'config load failed' );
26     ok( $@, "error thrown ($@)" ); 
27 }