]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/commitdiff
Make sure $test_sub returns a code reference
authorVincent Pit <vince@profvince.com>
Fri, 7 Sep 2012 17:53:18 +0000 (19:53 +0200)
committerVincent Pit <vince@profvince.com>
Fri, 7 Sep 2012 17:53:18 +0000 (19:53 +0200)
lib/VPIT/TestHelpers.pm

index abee64079108f825b1be4d9d0138f6dccc5c9a03..42ff1897e3a869c6f79028347bc6f4784cad5425 100644 (file)
@@ -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]) }