fix for ini subsections (RT #32726), use from_json for JSON v2.x, refactor test suite.
[p5sagit/Config-Any.git] / t / 52-json.t
index f4e45c3..5467ebe 100644 (file)
@@ -1,11 +1,18 @@
-use Test::More tests => 2;\r
-\r
-use Config::Any::JSON;\r
-\r
-my $config = eval { Config::Any::JSON->load( 't/conf/conf.json' ) };\r
-\r
-SKIP: {\r
-    skip "Couldn't Load JSON plugin", 2 if $@;\r
-    ok( $config );\r
-    is( $config->{ name }, 'TestApp' );\r
-}\r
+use strict;
+use warnings;
+
+use Test::More;
+use Config::Any::JSON;
+
+if ( !Config::Any::JSON->is_supported ) {
+    plan skip_all => 'JSON format not supported';
+}
+else {
+    plan tests => 2;
+}
+
+{
+    my $config = Config::Any::JSON->load( 't/conf/conf.json' );
+    ok( $config );
+    is( $config->{ name }, 'TestApp' );
+}