This ensures that the releaser runs *all* tests.
test => {
requires => {
'Test::More' => '0.88',
+ 'Test::Needs' => '0.002006',
},
},
},
use Test::More 0.88;
use JSON::MaybeXS;
-unless ( eval { require Cpanel::JSON::XS; 1 } ) {
- plan skip_all => 'No Cpanel::JSON::XS';
-}
-
+use Test::Needs 'Cpanel::JSON::XS';
diag 'Using Cpanel::JSON::XS ', Cpanel::JSON::XS->VERSION;
is( JSON, 'Cpanel::JSON::XS', 'Correct JSON class' );
sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" };
} qw{Cpanel/JSON/XS.pm JSON/XS.pm};
-use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP';
+use Test::Needs 'JSON::PP';
use Test::More 0.88;
use JSON::MaybeXS;
use strict;
use warnings;
-use if !eval { require Cpanel::JSON::XS; 1; }, 'Test::More', skip_all => 'No Cpanel::JSON::XS';
+
+use Test::Needs 'Cpanel::JSON::XS'; # load first, before JSON::MaybeXS
use Test::More 0.88;
use JSON::MaybeXS;
use strict;
use warnings;
-use if !eval { require JSON::XS; JSON::XS->VERSION(3.0); 1; }, 'Test::More', skip_all => 'No JSON::XS';
+use Test::Needs { 'JSON::XS' => '3.0' }; # load first, before JSON::MaybeXS
use Test::More 0.88;
use JSON::MaybeXS;
use Test::More 0.88;
use JSON::MaybeXS;
-unless ( eval { require JSON::XS; 1 } ) {
- plan skip_all => 'No JSON::XS';
-}
-
+use Test::Needs 'JSON::XS';
diag 'Using JSON::XS ', JSON::XS->VERSION;
is( JSON, 'JSON::XS', 'Correct JSON class' );