-use Test::More tests => 2;\r
-\r
-use Config::Any::YAML;\r
-\r
-my $config = eval { Config::Any::YAML->load( 't/conf/conf.yml' ) };\r
-\r
-SKIP: {\r
- skip "Couldn't Load YAML plugin", 2 if $@;\r
- ok( $config );\r
- is( $config->{ name }, 'TestApp' );\r
-}\r
+use strict;
+use warnings;
+no warnings 'once';
+
+use Test::More;
+use Config::Any::YAML;
+
+if ( !Config::Any::YAML->is_supported ) {
+ plan skip_all => 'YAML format not supported';
+}
+else {
+ plan tests => 4;
+}
+
+{
+ my $config = Config::Any::YAML->load( 't/conf/conf.yml' );
+ 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 ($@)" );
+}