skip xml failure tests if XML::LibXML < 1.59 is installed, it seems to parse anything...
[p5sagit/Config-Any.git] / t / 55-yaml.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Config::Any::YAML;
6
7 if ( !Config::Any::YAML->is_supported ) {
8     plan skip_all => 'YAML format not supported';
9 }
10 else {
11     plan tests => 4;
12 }
13
14 {
15     my $config = Config::Any::YAML->load( 't/conf/conf.yml' );
16     ok( $config );
17     is( $config->{ name }, 'TestApp' );
18 }
19
20 # test invalid config
21 {
22     my $file = 't/invalid/conf.yml';
23     my $config = eval { Config::Any::YAML->load( $file ) };
24
25     ok( !$config, 'config load failed' );
26     ok( $@, "error thrown ($@)" );
27 }