From: Vincent Pit Date: Fri, 7 Sep 2012 17:53:18 +0000 (+0200) Subject: Make sure $test_sub returns a code reference X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ff556dd3539e55eb8d925721dd650c57973f39c4;p=perl%2Fmodules%2FVPIT-TestHelpers.git Make sure $test_sub returns a code reference --- diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index abee640..42ff189 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -25,7 +25,8 @@ my $test_sub = sub { require Test::More; $stash = \%Test::More::; } - return $stash->{$sub}; + my $glob = $stash->{$sub}; + return $glob ? *$glob{CODE} : undef; }; sub skip_all { $test_sub->('plan')->(skip_all => $_[0]) }