Kwalitee test overhaul
authorVincent Pit <vince@profvince.com>
Sat, 26 Sep 2009 09:53:10 +0000 (11:53 +0200)
committerVincent Pit <vince@profvince.com>
Sat, 26 Sep 2009 10:06:03 +0000 (12:06 +0200)
t/99-kwalitee.t

index 7775e60..185d4ce 100644 (file)
@@ -5,5 +5,17 @@ use warnings;
 
 use Test::More;
 
-eval { require Test::Kwalitee; Test::Kwalitee->import() };
-plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;
+eval { require Test::Kwalitee; };
+plan(skip_all => 'Test::Kwalitee not installed') if $@;
+
+SKIP: {
+ eval { Test::Kwalitee->import(); };
+ if (my $err = $@) {
+  1 while chomp $err;
+  require Test::Builder;
+  my $Test = Test::Builder->new;
+  my $plan = $Test->has_plan;
+  $Test->skip_all($err) if not defined $plan or $plan eq 'no_plan';
+  skip $err => $plan - $Test->current_test;
+ }
+}