Bump version to accomodate pre-beta testers
[dbsrgits/DBIx-Class.git] / xt / dist / postdistdir / pod_footers.t
CommitLineData
e48635f7 1BEGIN { $ENV{DBICTEST_ANFANG_DEFANG} = 1 }
2
a2bd3796 3use warnings;
4use strict;
5
6use Test::More;
7use File::Find;
8
e48635f7 9use lib 't/lib';
10use DBICTest; # for the lock
11use DBICTest::Util 'slurp_bytes';
12
a2bd3796 13my $boilerplate_headings = q{
14=head1 FURTHER QUESTIONS?
15
16Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
17
18=head1 COPYRIGHT AND LICENSE
19
20This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
21by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
22redistribute it and/or modify it under the same terms as the
23L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
24};
25
26find({
27 wanted => sub {
28 my $fn = $_;
29
30 return unless -f $fn;
31 return unless $fn =~ / \. (?: pm | pod ) $ /ix;
399b9455 32 return if $fn =~ qr{\Qlib/DBIx/Class/_TempExtlib/};
a2bd3796 33
e48635f7 34 my $data = slurp_bytes $fn;
a2bd3796 35
36 if ($data !~ /^=head1 NAME/m) {
37
38 # the generator is full of false positives, .pod is where it's at
39 return if $fn =~ qr{\Qlib/DBIx/Class/Optional/Dependencies.pm};
40
41 ok ( $data !~ /\bcopyright\b/i, "No copyright notices in $fn without apparent POD" );
42 }
43 elsif ($fn =~ qr{\Qlib/DBIx/Class.}) {
44 # nothing to check there - a static set of words
45 }
46 else {
47 ok ( $data !~ / ^ =head1 \s $_ /xmi, "No standalone $_ headings in $fn" )
48 for qw(AUTHOR CONTRIBUTOR LICENSE LICENCE);
49
50 ok ( $data !~ / ^ =head1 \s COPYRIGHT \s (?! AND \s LICENSE )/xmi, "No standalone COPYRIGHT headings in $fn" );
51
52 ok ($data =~ / \Q$boilerplate_headings\E (?! .*? ^ =head )/xms, "Expected headings found at the end of $fn");
53 }
54 },
55 no_chdir => 1,
56}, (qw(lib examples)) );
57
58done_testing;