From: Vincent Pit Date: Wed, 30 Jan 2013 15:57:11 +0000 (-0200) Subject: Add some spacing X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ad3fa9ca5eefe61d54be06d88b6f8281779f88ac;p=perl%2Fmodules%2FVPIT-TestHelpers.git Add some spacing --- diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index 42ff189..8e05629 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -10,6 +10,7 @@ my %exports = ( sub import { my $pkg = caller; + while (my ($name, $code) = each %exports) { no strict 'refs'; *{$pkg.'::'.$name} = $code; @@ -18,6 +19,7 @@ sub import { my $test_sub = sub { my $sub = shift; + my $stash; if ($INC{'Test/Leaner.pm'}) { $stash = \%Test::Leaner::; @@ -25,6 +27,7 @@ my $test_sub = sub { require Test::More; $stash = \%Test::More::; } + my $glob = $stash->{$sub}; return $glob ? *$glob{CODE} : undef; }; @@ -46,6 +49,7 @@ sub load_or_skip { 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];