package Pod::Snippets; use warnings; use strict; =head1 NAME
Pod::Snippets - Extract and reformat snippets of POD so as to
use them in a unit test (or other Perl code) =head1 VERSION
Version 0.14 =cut use vars qw($VERSION); $VERSION = '0.14';
=head1 SYNOPSIS =for metatests "synopsis test script" begin use
Pod::Snippets; my $snips = load Pod::Snippets($file_or_handle,
-markup => "test"); my $code_snippet =
$snips->named("synopsis")->as_code; # ... Maybe borg
$code_snippet with regexes or something... my $result = eval
$code_snippet; die $@ if $@; like($result->what_happen(),
qr/bomb/); =for metatests "synopsis test script" end The Perl
code that we want to extract snippets from might look like this:
=for metatests "synopsis POD" begin package Zero::Wing; =head1
NAME Zero::Wing - For great justice! =head1 SYNOPSIS =for test
"synopsis" begin use Zero::Wing; my $capitain =
Zero::Wing->capitain; =for test "synopsis" end =cut # ... 1;
=for metatests "synopsis POD" end =head1 DESCRIPTION This class
is a very simple