Get rid of Path::Class ( that *does* feel good )
[dbsrgits/DBIx-Class-Historic.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;
a2bd3796 32
e48635f7 33 my $data = slurp_bytes $fn;
a2bd3796 34
35 if ($data !~ /^=head1 NAME/m) {
36
37 # the generator is full of false positives, .pod is where it's at
38 return if $fn =~ qr{\Qlib/DBIx/Class/Optional/Dependencies.pm};
39
40 ok ( $data !~ /\bcopyright\b/i, "No copyright notices in $fn without apparent POD" );
41 }
42 elsif ($fn =~ qr{\Qlib/DBIx/Class.}) {
43 # nothing to check there - a static set of words
44 }
45 else {
46 ok ( $data !~ / ^ =head1 \s $_ /xmi, "No standalone $_ headings in $fn" )
47 for qw(AUTHOR CONTRIBUTOR LICENSE LICENCE);
48
49 ok ( $data !~ / ^ =head1 \s COPYRIGHT \s (?! AND \s LICENSE )/xmi, "No standalone COPYRIGHT headings in $fn" );
50
51 ok ($data =~ / \Q$boilerplate_headings\E (?! .*? ^ =head )/xms, "Expected headings found at the end of $fn");
52 }
53 },
54 no_chdir => 1,
55}, (qw(lib examples)) );
56
57done_testing;