Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no longer loading UNIVERSAL::isa and UNIVERSAL::can by default #7

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for Perl extension Test::MockObject.

{{$NEXT}}
- no longer loading UNIVERSAL::isa and UNIVERSAL::can by default; use the
'-override_universal' import option to do that

1.20110612 2011-06-11 23:53:50 America/Los_Angeles
- removed Module::Build detritus
Expand Down
17 changes: 13 additions & 4 deletions lib/Test/MockObject.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ sub import
{
my $self = shift;
return unless grep /^-debug/, @_;
eval "use UNIVERSAL::isa 'verbose'";
eval "use UNIVERSAL::can '-always_warn'";
require UNIVERSAL::isa; 'UNIVERSAL::isa'->import('verbose');
require UNIVERSAL::can; 'UNIVERSAL::can'->import('-always_warn');

if (grep /^-debug/, @_) {
require UNIVERSAL::isa; 'UNIVERSAL::isa'->import('verbose');
require UNIVERSAL::can; 'UNIVERSAL::can'->import('-always_warn');
}
elsif (grep /^-override_universal$/, @_) {
require UNIVERSAL::isa;
require UNIVERSAL::can;
}
}

use Test::Builder;
Expand Down Expand Up @@ -489,9 +498,9 @@ module, consider L<Test::MockObject::Extends> instead.
=item * If the code under testing produces strange errors about type checks,
pass the C<-debug> flag when using C<Test::MockObject> or
C<Test::MockObject::Extends>. This will load both L<UNIVERSAL::isa> and
L<UNIVERSAL::can> to perform additional debugging on the incorrect use of both
L<UNIVERSAL::can> to perform additional debugging on the use of both
methods from the L<UNIVERSAL> package. (This behavior used to be active by
default, but that was, however correct, probably a burden to onerous for the
default, but that was, however correct, probably a burden too onerous for the
CPAN.)

=back
Expand Down