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