prep release
[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
5a2e0210 8if ( !Config::Any::YAML->is_supported ) {
9 plan skip_all => 'YAML format not supported';
10}
11else {
5770ffc0 12 plan tests => 4;
5a2e0210 13}
f0e3c221 14
5a2e0210 15{
16 my $config = Config::Any::YAML->load( 't/conf/conf.yml' );
f0e3c221 17 ok( $config );
18 is( $config->{ name }, 'TestApp' );
19}
5770ffc0 20
21# test invalid config
22{
77f14cda 23 my $file = 't/invalid/conf.yml';
5770ffc0 24 my $config = eval { Config::Any::YAML->load( $file ) };
25
26 ok( !$config, 'config load failed' );
dcfb1d1d 27 ok( $@, "error thrown ($@)" );
5770ffc0 28}