SYNOPSIS

        #!/usr/bin/perl
        use strict; use warnings;

        use Test::More;

        eval "use Test::Pod::No404s";
        if ( $@ ) {
                plan skip_all => 'Test::Pod::No404s required for testing POD';
        } else {
                all_pod_files_ok();
        }

ABSTRACT

Using this test module will check your \s-1POD\s0 for any http 404 links.

DESCRIPTION

This module looks for any http(s) links in your \s-1POD\s0 and verifies that they will not return a 404. It uses LWP::UserAgent for the heavy lifting, and simply lets you know if it failed to retrieve the document. More specifically, it uses $response->is_error as the \*(L"test.\*(R"

Normally, you wouldn't want this test to be run during end-user installation because they might have no internet! It is \s-1HIGHLY\s0 recommended that this be used only for module authors' \s-1RELEASE_TESTING\s0 phase. To do that, just modify the synopsis to add an env check :)

Methods

This function is what you will usually run. It automatically finds any \s-1POD\s0 in your distribution and runs checks on them.

Accepts an optional argument: an array of files to check. By default it checks all \s-1POD\s0 files it can find in the distribution. Every file it finds is passed to the \*(C`pod_file_ok\*(C' function.

pod_file_ok( \s-1FILENAME\s0, [ \s-1TESTNAME\s0 ] )

\*(C`pod_file_ok()\*(C' will okay the test if there is no http(s) links present in the \s-1POD\s0 or if all links are not an error. Furthermore, if the \s-1POD\s0 was malformed as reported by Pod::Simple, the test will fail and not attempt to check the links.

When it fails, \*(C`pod_file_ok()\*(C' will show any failing links as diagnostics.

The optional second argument \s-1TESTNAME\s0 is the name of the test. If it is omitted, \*(C`pod_file_ok()\*(C' chooses a default test name \*(L"404 test for \s-1FILENAME\s0\*(R".

EXPORT

Automatically exports the two subs.

RELATED TO Test::Pod::No404s…

LWP::UserAgent

Pod::Simple

Test::Pod

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Test::Pod::No404s

Websites

  • Search \s-1CPAN\s0 <http://search.cpan.org/dist/Test-Pod-No404s>

  • AnnoCPAN: Annotated \s-1CPAN\s0 documentation <http://annocpan.org/dist/Test-Pod-No404s>

  • \s-1CPAN\s0 Ratings <http://cpanratings.perl.org/d/Test-Pod-No404s>

  • \s-1CPAN\s0 Forum <http://cpanforum.com/dist/Test-Pod-No404s>

  • \s-1RT:\s0 \s-1CPAN\s0's Request Tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Pod-No404s>

  • \s-1CPANTS\s0 Kwalitee <http://cpants.perl.org/dist/overview/Test-Pod-No404s>

  • \s-1CPAN\s0 Testers Results <http://cpantesters.org/distro/T/Test-Pod-No404s.html>

  • \s-1CPAN\s0 Testers Matrix <http://matrix.cpantesters.org/?dist=Test-Pod-No404s>

  • Git Source Code Repository <http://github.com/apocalypse/perl-test-pod-no404s>

Bugs

Please report any bugs or feature requests to \*(C`bug-test-pod-no404s at rt.cpan.org\*(C', or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Pod-No404s>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

AUTHOR

Apocalypse <[email protected]>

Thanks to the author of Test::Pod for the basic framework of this module!

Thanks to the \s-1POE\s0 guys for finding 404 links in their \s-1POD\s0, and was the inspiration for this module.

COPYRIGHT AND LICENSE

Copyright 2010 by Apocalypse

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.