X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F55-yaml.t;h=caf6f66650311653ac08d2196ada7bfbbc30ab3e;hb=d8d4d54349e2d5a4f767674e4844fd1cd2055019;hp=3c95831e6e28243d9687002642d136fc6064ccb3;hpb=5a2e0210fe5c7da046be37b4240008f2b667be67;p=p5sagit%2FConfig-Any.git diff --git a/t/55-yaml.t b/t/55-yaml.t index 3c95831..caf6f66 100644 --- a/t/55-yaml.t +++ b/t/55-yaml.t @@ -1,14 +1,17 @@ use strict; use warnings; +no warnings 'once'; use Test::More; use Config::Any::YAML; +$Config::Any::YAML::NO_YAML_XS_WARNING = 1; + if ( !Config::Any::YAML->is_supported ) { plan skip_all => 'YAML format not supported'; } else { - plan tests => 2; + plan tests => 4; } { @@ -16,3 +19,12 @@ else { ok( $config ); is( $config->{ name }, 'TestApp' ); } + +# test invalid config +{ + my $file = 't/invalid/conf.yml'; + my $config = eval { Config::Any::YAML->load( $file ) }; + + ok( !$config, 'config load failed' ); + ok( $@, "error thrown ($@)" ); +}