add XML::NamespaceSupport to XML format deps, silence YAML warnings in tests
[p5sagit/Config-Any.git] / t / 55-yaml.t
1 use strict;
2 use warnings;
3 no warnings 'once';
4
5 use Test::More;
6 use Config::Any::YAML;
7
8 $Config::Any::YAML::NO_YAML_XS_WARNING = 1;
9
10 if ( !Config::Any::YAML->is_supported ) {
11     plan skip_all => 'YAML format not supported';
12 }
13 else {
14     plan tests => 4;
15 }
16
17 {
18     my $config = Config::Any::YAML->load( 't/conf/conf.yml' );
19     ok( $config );
20     is( $config->{ name }, 'TestApp' );
21 }
22
23 # test invalid config
24 {
25     my $file = 't/invalid/conf.yml';
26     my $config = eval { Config::Any::YAML->load( $file ) };
27
28     ok( !$config, 'config load failed' );
29     ok( $@,       "error thrown ($@)" );
30 }