X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F52-json.t;h=5467ebe6c7e4d6da38434fd737eb73d27adbcb90;hp=f4e45c3e947b4a70b6eff37127f254f031979920;hb=8af0a7cf96c671f13244fec2e0f15a4c13f2737d;hpb=572501abb2165014af8973bf9a4aa1f8a522356d diff --git a/t/52-json.t b/t/52-json.t index f4e45c3..5467ebe 100644 --- a/t/52-json.t +++ b/t/52-json.t @@ -1,11 +1,18 @@ -use Test::More tests => 2; - -use Config::Any::JSON; - -my $config = eval { Config::Any::JSON->load( 't/conf/conf.json' ) }; - -SKIP: { - skip "Couldn't Load JSON plugin", 2 if $@; - ok( $config ); - is( $config->{ name }, 'TestApp' ); -} +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' ); +}