]> git.vpit.fr Git - perl/modules/Test-Leaner.git/commitdiff
Clean up the import replacement a bit
authorVincent Pit <vince@profvince.com>
Tue, 18 Jan 2011 10:30:24 +0000 (11:30 +0100)
committerVincent Pit <vince@profvince.com>
Tue, 18 Jan 2011 10:30:24 +0000 (11:30 +0100)
lib/Test/Leaner.pm

index f1ee6ee4ac04d85d009628e8a86aa141d81bc67f..80cac1328e33a3d8ce13d604f82b21efb7353a4c 100644 (file)
@@ -180,6 +180,7 @@ if ($ENV{PERL_TEST_LEANER_USES_TEST_MORE}) {
 
  my $import = sub {
   shift;
+
   my @imports = &_handle_import_args;
   @imports = @EXPORT unless @imports;
   my @test_more_imports;
@@ -192,7 +193,10 @@ if ($ENV{PERL_TEST_LEANER_USES_TEST_MORE}) {
     *{$pkg."::$_"} = $leaner_stash->{$_};
    }
   }
+
   my $test_more_import = 'Test::More'->can('import');
+  return unless $test_more_import;
+
   @_ = (
    'Test::More',
    @_,
@@ -202,6 +206,7 @@ if ($ENV{PERL_TEST_LEANER_USES_TEST_MORE}) {
    lock $plan if THREADSAFE;
    push @_, 'no_diag' if $no_diag;
   }
+
   goto $test_more_import;
  };