sub import {
my $pkg = caller;
+
while (my ($name, $code) = each %exports) {
no strict 'refs';
*{$pkg.'::'.$name} = $code;
my $test_sub = sub {
my $sub = shift;
+
my $stash;
if ($INC{'Test/Leaner.pm'}) {
$stash = \%Test::Leaner::;
require Test::More;
$stash = \%Test::More::;
}
+
my $glob = $stash->{$sub};
return $glob ? *$glob{CODE} : undef;
};
if (eval "use $spec (); 1") {
$ver = do { no strict 'refs'; ${"${pkg}::VERSION"} };
$ver = 'undef' unless defined $ver;
+
if ($imports) {
my @imports = @$imports;
my $caller = (caller 0)[0];