Subject: | all modules fail to load under Test::Without |
This module fails much worse than Devel::Hide's case. Devel::Hide only fails on the hidden module, however, Test::Without fails on *every* module regardless.
perl /tmp/test_without.pl
not ok 1 - Hidden package does not cause exceptions
# Failed test 'Hidden package does not cause exceptions'
# at /tmp/test_without.pl line 21.
# Can't locate object method "INC" via package "Test::Without::coderef" at /home/kent/perl5/perlbrew/perls/5.21.8-c/lib/site_perl/5.21.9/Module/Runtime.pm line 317.
1..1
# Looks like you failed 1 test of 1.
Subject: | test_without.pl |
use strict;
use warnings;
use Test::More;
BEGIN {
eval { require Test::Without; 1 } or plan skip_all => "Test::Without required for this test";
}
use Test::Without;
use Module::Runtime qw( require_module );
my $error;
my $return;
my $ok;
run {
local $@;
eval { $return = require_module(qw( if )); $ok = 1 };
$error = $@;
} without "I::Do::Not::Exist";
ok( $ok, "Hidden package does not cause exceptions" ) or diag explain $error;
done_testing;