Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Differences CPAN distribution.

Report information
The Basics
Id: 64489
Status: rejected
Priority: 0/
Queue: Test-Differences

People
Owner: Nobody in particular
Requestors: mark.zealey [...] webfusion.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.500
Fixed in: (no value)



Subject: our $warned_of_unknown_test_lib; ?
Download (untitled) / with headers
text/plain 237b
Hi again, I know I'm being a bit silly using this for non-testing routines but would it be possible to change the scope of $warned_of_unknown_test_lib to our so I can change it from outside to disable warnings if I really want to? Mark
Download (untitled) / with headers
text/plain 1.4k
On Wed Jan 05 07:10:03 2011, mzealey wrote: Show quoted text
> Hi again, > > I know I'm being a bit silly using this for non-testing routines but > would it be possible to change the scope of $warned_of_unknown_test_lib > to our so I can change it from outside to disable warnings if I really > want to? > > Mark
It's hard for me to justify this hack for an unknown use case, but I looked into it briefly. If you really want to use this for non-testing code, sub _identify_callers_test_package_of_choice { ## This is called at each test in case Test::Differences was used before ## the base testing modules. ## First see if %INC tells us much of interest. my $has_builder_pm = grep $_ eq "Test/Builder.pm", keys %INC; my $has_test_pm = grep $_ eq "Test.pm", keys %INC; return "Test" if $has_test_pm && !$has_builder_pm; return "Test::Builder" if !$has_test_pm && $has_builder_pm; if ( $has_test_pm && $has_builder_pm ) { ## TODO: Look in caller's namespace for hints. For now, assume Builder. ## This should only ever be an issue if multiple test suites end ## up in memory at once. return "Test::Builder"; } } As a hack on top of this hack, you should just be able to "use Test::Builder". That adds it to %INC and makes this problem magically go away. Let me know if that works for you. Cheers, Curtis
Download (untitled) / with headers
text/plain 418b
On Wed Jan 05 07:10:03 2011, mzealey wrote: Show quoted text
> Hi again, > > I know I'm being a bit silly using this for non-testing routines but > would it be possible to change the scope of $warned_of_unknown_test_lib > to our so I can change it from outside to disable warnings if I really > want to? > > Mark
No feedback three years after work-around suggested, so marking ticket as 'rejected' just to clear it out of the queue.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.