Permalink
Browse files

Add test for reports which can/can't launch

Not entirely sure this test is in the right place.
  • Loading branch information...
1 parent bd43b6f commit 69234863b808b669023cf88024f70e3dedb76bcd @sdt sdt committed Apr 29, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 t/internal/launch.t
View
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+opendir my $d, 'lib/Devel/Cover/Report';
+my @reporters = grep { s/\.pm$// } readdir($d);
+closedir $d;
+
+plan tests => scalar @reporters;
+
+my @reporters_with_launch = qw(
+ Html Html_basic Html_minimal Html_subtle
+);
+
+# Check that the expected reporters support the launch feature
+for my $reporter (@reporters) {
+ my $class = 'Devel::Cover::Report::' . $reporter;
+ eval "require $class";
+
+ if (grep { $_ eq $reporter } @reporters_with_launch) {
+ ok($class->can('launch'), "$reporter supports launch");
+ }
+ else {
+ ok(! $class->can('launch'), "$reporter does not support launch");
+ }
+}

0 comments on commit 6923486

Please sign in to comment.