/usr/share/perl5/unmocked.pm is in libmocked-perl 0.09-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | package unmocked;
use strict;
use warnings;
use mocked;
=head1 NAME
unmocked - use real libraries from within mocked libraries
=head1 SYNOPSIS
# Your mocked module needs to use a real library
package Fake::Fun;
use unmocked 'URI';
=head1 DESCRIPTION
When mocking modules using 'mocked', you are certain that no extra "real"
libraries are being loaded. But sometimes you don't want to use real
libraries from within your mocked library. This module allows you to load
real libraries using your previous include paths.
=cut
our $VERSION = '0.01';
=head1 FUNCTIONS
=head2 import
With a package name, this function will ensure that the module you specify
is loaded from the regular @INC path (that mocked.pm has removed).
=cut
sub import {
my $class = shift;
my $module = shift;
return unless $module;
{
local @INC = @$mocked::real_inc_paths;
eval "require $module";
}
die $@ if $@;
my $import = $module->can('import');
@_ = ($module, @_);
goto &$import if $import;
}
=head1 AUTHOR
Luke Closs, C<< <cpan at 5thplane.com> >>
=head1 LICENSE
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;
|