Some OCD cleanup; addition of Travis and Coveralls

This commit is contained in:
Gryphon Shafer
2014-09-25 11:04:31 -07:00
parent e7764f004b
commit 956d549bcd
13 changed files with 120 additions and 138 deletions
+4 -6
View File
@@ -1,8 +1,6 @@
#!perl -T
use Test::More tests => 1;
BEGIN {
use_ok( 'SQL::Abstract::Complete' ) || print "Bail out!\n";
}
#!/usr/bin/env perl
use Test::Most;
BEGIN { use_ok('SQL::Abstract::Complete') }
diag( "Testing SQL::Abstract::Complete $SQL::Abstract::Complete::VERSION, Perl $], $^X" );
done_testing();
+3 -1
View File
@@ -1,7 +1,7 @@
use strict;
use warnings;
use Test::More 'tests' => 22;
use Test::Most;
use constant MODULE => 'SQL::Abstract::Complete';
@@ -147,3 +147,5 @@ is(
is( $sac->_sqlcase('from'), 'FROM', q{$sac->_sqlcase('from')} );
is( $sac->_sqlcase(undef), '', '$sac->_sqlcase(undef)' );
done_testing;
-51
View File
@@ -1,51 +0,0 @@
#!perl -T
use strict;
use warnings;
use Test::More tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename ) 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}||=[]}, $.;
}
}
}
if (%violated) {
fail("$filename contains boilerplate text");
diag "$_ appears on lines @{$violated{$_}}" for ( keys %violated );
}
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]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/SQL/Abstract/Complete.pm');
}
+11 -7
View File
@@ -1,8 +1,12 @@
#!perl -T
use strict;
use warnings;
use Test::More;
#!/usr/bin/env perl
use Test::Most;
eval "use Test::CheckManifest 0.9";
plan skip_all => "Test::CheckManifest 0.9 required" if $@;
ok_manifest({filter => [qr/\.git/]});
eval('use Test::CheckManifest 0.9');
plan( 'skip_all' => "Test::CheckManifest 0.9 required" ) if $@;
ok_manifest( { 'filter' => [
qr/\.git/,
qr/\.travis\.yml$/,
qr/perl-travis-helper/,
qr/cover_db/,
] } );
done_testing();
+8 -14
View File
@@ -1,19 +1,13 @@
#!perl -T
use strict;
use warnings;
use Test::More;
#!/usr/bin/env perl
use Test::Most;
# 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 $@;
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 $@;
eval("use Pod::Coverage $min_pc");
plan( 'skip_all' => "Pod::Coverage $min_pc required for testing POD coverage" ) if $@;
all_pod_coverage_ok();
all_pod_coverage_ok( { 'trustme' => ['BUILD'] } );
done_testing();
+5 -7
View File
@@ -1,11 +1,9 @@
#!perl -T
use strict;
use warnings;
use Test::More;
#!/usr/bin/env perl
use Test::Most;
# 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 $@;
eval("use Test::Pod $min_tp");
plan( 'skip_all' => "Test::Pod $min_tp required for testing POD" ) if $@;
all_pod_files_ok();
done_testing();