From: David Golden Date: Tue, 28 Jun 2016 22:16:33 +0000 (-0700) Subject: remove test dependency on Test::Without::Module (RT#115394) X-Git-Tag: v1.003006_001~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4d741691e1fcefe51c5f1d563d23e3951c2a30c;p=p5sagit%2FJSON-MaybeXS.git remove test dependency on Test::Without::Module (RT#115394) --- diff --git a/Changes b/Changes index 23c0fd6..34407ca 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ Revision history for JSON-MaybeXS values - we now always upgrade JSON::XS if it is installed and below version 3.0, due to changes in handling booleans + - remove test dependency on Test::Without::Module (RT#115394) 1.003005 - 2015-03-22 - fix x_contributors metadata that was killing metacpan (see diff --git a/Makefile.PL b/Makefile.PL index 4bb2e4f..a2e1a60 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -60,7 +60,6 @@ my %WriteMakefileArgs = ( }, test => { requires => { - 'Test::Without::Module' => '0.17', 'Test::More' => '0.88', }, }, diff --git a/t/legacy.t b/t/legacy.t index 20223ec..fb5cc19 100644 --- a/t/legacy.t +++ b/t/legacy.t @@ -1,7 +1,12 @@ use strict; use warnings; -use Test::Without::Module 'Cpanel::JSON::XS'; +# hide Cpanel::JSON::XS +use lib map { + my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); + sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } +} qw{Cpanel/JSON/XS.pm}; + use Test::More 0.88; use JSON::MaybeXS qw/:legacy/; diff --git a/t/none.t b/t/none.t index c3d350a..12faf52 100644 --- a/t/none.t +++ b/t/none.t @@ -1,16 +1,18 @@ use strict; use warnings; -use Test::Without::Module 'Cpanel::JSON::XS'; -use Test::Without::Module 'JSON::XS'; -use Test::Without::Module 'JSON::PP'; + +# hide Cpanel::JSON::XS, JSON::XS, JSON::PP +use lib map { + my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); + sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } +} qw{Cpanel/JSON/XS.pm JSON/XS.pm JSON/PP.pm}; + use Test::More 0.88; ok(!eval { require JSON::MaybeXS; 1 }, 'Class failed to load'); -# Test::Without::Module always causes 'did not return a true value' errors - like( - $@, qr{Cpanel/JSON/XS.pm did not.*JSON/XS.pm did not.*JSON/PP.pm did not}s, + $@, qr{Can't locate Cpanel/JSON/XS\.pm.*Can't locate JSON/XS\.pm.*Can't locate JSON/PP\.pm}s, 'All errors reported' ); diff --git a/t/pp.t b/t/pp.t index 1d213fb..9aa020f 100644 --- a/t/pp.t +++ b/t/pp.t @@ -1,7 +1,12 @@ use strict; use warnings; -use Test::Without::Module 'Cpanel::JSON::XS', 'JSON::XS'; +# hide Cpanel::JSON::XS, JSON::XS +use lib map { + my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); + sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } +} qw{Cpanel/JSON/XS.pm JSON/XS.pm}; + use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP'; use Test::More 0.88; use JSON::MaybeXS; diff --git a/t/xs.t b/t/xs.t index d57a030..8caa2ad 100644 --- a/t/xs.t +++ b/t/xs.t @@ -1,7 +1,12 @@ use strict; use warnings; -use Test::Without::Module 'Cpanel::JSON::XS'; +# hide Cpanel::JSON::XS +use lib map { + my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); + sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } +} qw{Cpanel/JSON/XS.pm}; + use Test::More 0.88; use JSON::MaybeXS;