From: Peter Rabbitson Date: Wed, 30 Oct 2013 08:16:39 +0000 (+0100) Subject: Work around JSON::Any not being future-proof X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de895f0944b944ef52a79b889415a37807130c4b;p=dbsrgits%2FDBIx-Class-Historic.git Work around JSON::Any not being future-proof https://rt.cpan.org/Ticket/Display.html?id=89853 https://github.com/perigrin/json-any/pull/2 --- diff --git a/t/admin/10script.t b/t/admin/10script.t index 9f4ab90..2a26659 100644 --- a/t/admin/10script.t +++ b/t/admin/10script.t @@ -18,11 +18,10 @@ BEGIN { delete $ENV{JSON_ANY_ORDER}; } -use JSON::Any; - $ENV{PATH} = ''; $ENV{PERL5LIB} = join ($Config{path_sep}, @INC); +require JSON::Any; my @json_backends = qw/XS JSON DWIW/; # test the script is setting @INC properly @@ -42,9 +41,9 @@ cmp_ok ($? >> 8, '==', 71, 'Correct schema loaded via testconfig'); for my $js (@json_backends) { - eval {JSON::Any->import ($js) }; SKIP: { - skip ("JSON backend $js is not available, skip testing", 1) if $@; + eval {JSON::Any->import ($js); 1 } + or skip ("JSON backend $js is not available, skip testing", 1); local $ENV{JSON_ANY_ORDER} = $js; eval { test_dbicadmin () };