Browse files

removing conditionals

  • Loading branch information...
1 parent a0f78a3 commit 2bdd11dbb3a7056895872d40ea5a90a8f9ebbbfa @kentfredric kentfredric committed Jul 5, 2009
Showing with 26 additions and 41 deletions.
  1. +14 −14 xt/boilerplate.t
  2. +0 −11 xt/kwaliee.t
  3. +9 −0 xt/kwalitee.t
  4. +2 −13 xt/pod-coverage.t
  5. +1 −3 xt/pod.t
View
28 xt/boilerplate.t
@@ -5,42 +5,42 @@ use warnings;
use Test::More tests => 1;
sub not_in_file_ok {
- my ($filename, %regex) = @_;
+ my ( $filename, %regex ) = @_;
open( my $fh, '<', $filename )
- or die "couldn't open $filename for reading: $!";
+ or die "couldn't open $filename for reading: $!";
my %violated;
- while (my $line = <$fh>) {
- while (my ($desc, $regex) = each %regex) {
- if ($line =~ $regex) {
- push @{$violated{$desc}||=[]}, $.;
+ while ( my $line = <$fh> ) {
+ while ( my ( $desc, $regex ) = each %regex ) {
+ if ( $line =~ $regex ) {
+ push @{ $violated{$desc} ||= [] }, $.;
}
}
}
if (%violated) {
fail("$filename contains boilerplate text");
diag "$_ appears on lines @{$violated{$_}}" for keys %violated;
- } else {
+ }
+ else {
pass("$filename contains no boilerplate text");
}
}
sub module_boilerplate_ok {
my ($module) = @_;
- not_in_file_ok($module =>
- 'the great new $MODULENAME' => qr/ - The great new /,
- 'boilerplate description' => qr/Quick summary of what the module/,
- 'stub function definition' => qr/function[12]/,
+ not_in_file_ok(
+ $module => 'the great new $MODULENAME' => qr/ - The great new /,
+ 'boilerplate description' => qr/Quick summary of what the module/,
+ 'stub function definition' => qr/function[12]/,
);
}
TODO: {
- local $TODO = "Need to replace the boilerplate text";
-
- module_boilerplate_ok('lib/ELF/Extract/Sections.pm');
+ local $TODO = "Need to replace the boilerplate text";
+ module_boilerplate_ok('lib/ELF/Extract/Sections.pm');
}
View
11 xt/kwaliee.t
@@ -1,11 +0,0 @@
-
-use strict;
-use warnings;
-
-use Test::More;
-
-eval { require Test::Kwalitee; Test::Kwalitee->import() };
-plan( skip_all => "Test::Kwalitee not installed; skipping" ) if $@;
-
-
-
View
9 xt/kwalitee.t
@@ -0,0 +1,9 @@
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Kwalitee;
+
+
+
View
15 xt/pod-coverage.t
@@ -1,18 +1,7 @@
use strict;
use warnings;
use Test::More;
-
-# Ensure a recent version of Test::Pod::Coverage
-my $min_tpc = 1.08;
-eval "use Test::Pod::Coverage $min_tpc";
-plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
- if $@;
-
-# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
-# but older versions don't recognize some common documentation styles
-my $min_pc = 0.18;
-eval "use Pod::Coverage $min_pc";
-plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
- if $@;
+use Test::Pod::Coverage 1.08;
+use Pod::Coverage 0.18;
all_pod_coverage_ok();
View
4 xt/pod.t
@@ -5,8 +5,6 @@ use warnings;
use Test::More;
# Ensure a recent version of Test::Pod
-my $min_tp = 1.22;
-eval "use Test::Pod $min_tp";
-plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
+use Test::Pod 1.22;
all_pod_files_ok();

0 comments on commit 2bdd11d

Please sign in to comment.