throw error for missing perl files
[p5sagit/Config-Any.git] / t / 53-perl.t
index cd61a1f..1c26ff4 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9;
+use Test::More tests => 12;
 use Config::Any;
 use Config::Any::Perl;
 
@@ -44,3 +44,17 @@ use Config::Any::Perl;
     ok( !$config, 'config load failed' );
     ok( $@,       "error thrown ($@)" );
 }
+
+# test missing config
+{
+    my $file = 't/invalid/missing.pl';
+    my $config;
+    my $loaded = eval {
+        $config = Config::Any::Perl->load( $file );
+        1;
+    };
+
+    ok( !$loaded, 'config load failed' );
+    ok( !$config, 'config load failed' );
+    ok( $@,       "error thrown ($@)" );
+}