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