added a flatten_to_hash option to return a simple key-value hashref instead of the...
[p5sagit/Config-Any.git] / t / 52-json.t
index 5467ebe..23eb920 100644 (file)
@@ -8,7 +8,7 @@ if ( !Config::Any::JSON->is_supported ) {
     plan skip_all => 'JSON format not supported';
 }
 else {
-    plan tests => 2;
+    plan tests => 4;
 }
 
 {
@@ -16,3 +16,12 @@ else {
     ok( $config );
     is( $config->{ name }, 'TestApp' );
 }
+
+# test invalid config
+{
+    my $file   = 't/invalid/conf.json';
+    my $config = eval { Config::Any::JSON->load( $file ) };
+
+    ok( !$config, 'config load failed' );
+    ok( $@, "error thrown ($@)" ); 
+}