Subject: | Module-Runtime-0.012 t/dependency.t assumptions |
The latest release of Module-Runtime includes a test that makes an assumption that is not true
in the environment I support, which uses a sitecustomize.pl to automate several things, and
while that script is extremely minimal, it does:
use strict;
use warnings;
which means that ALL perl processes end up loading those modules.
t/dependency.t assumes that %INC will be empty before
use Module::Runtime qw(require_module);
is called, and in my case, this isn't true. The attached patch allows this test to succeed by
eliminating the assumption of an empty %INC, and changes it to explicitly check what was
added to %INC by that call.
I appreciate that my use case is an edge condition, but if you would accept this patch, it will be
one less that I have to maintain for our system, and it simply eliminates the assumption, and
make the test more explicit.
Your call. Thanks in advance, if you do...
Subject: | 01_t_dependency.patch |
diff -rc ../Module-Runtime-0.012-orig/t/dependency.t ./t/dependency.t
*** ../Module-Runtime-0.012-orig/t/dependency.t Sun Feb 12 05:54:02 2012
--- ./t/dependency.t Tue Feb 14 08:47:22 2012
***************
*** 2,8 ****
--- 2,10 ----
# script cannot itself use warnings, Test::More, or any other module.
BEGIN { print "1..1\n"; }
+ BEGIN { %INC_pre = %INC }
use Module::Runtime qw(require_module);
+ BEGIN { map { delete $INC{$_} } keys %INC_pre }
print join(" ", sort keys %INC) eq "Module/Runtime.pm" ? "" : "not ", "ok 1\n";
1;