Pod-Advent
view release on metacpan or search on metacpan
t/pod2advent.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More tests => 39;
use Test::Differences;
use IO::CaptureOutput qw(capture_exec);
use File::Temp qw(tempfile);
use File::Basename qw(fileparse);
my $CURYEAR = (localtime)[5] + 1900;
my @perl = ( $^X, '-Ilib' );
push @perl, '-MDevel::Cover=-silent,1,-db,cover_db,-ignore,.,+select,advent,+select,Advent' if exists $INC{'Devel/Cover.pm'};
my @files = (
[ 'ex/sample.pod', 'ex/sample.html', 'Possible SPELLING ERRORS:
href
lt
pre
mispelling
', ],
[ 'ex/getting_started.pod', 'ex/getting_started.html', '', ],
[ 'ex/footnotes.pod', 'ex/footnotes.html', 'Possible SPELLING ERRORS:
sourcedcode
', ],
[ '+', undef, '', 'B<test>', '<p><span style="font-weight: bold">test</span></p>' ],
[ '-', undef, '', 'B<test>', qq{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Pod::Advent 0.15 (Pod::Simple 3.07, Perl::Tidy 20071205) on 2008-12-19 23:48:02 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$CURYEAR Perl Advent Calendar: </title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<h1><a href="../">Perl Advent Calendar $CURYEAR-12</a>-00</h1>
<h2 align="center"></h2>
</body>
</html>} ],
[ '-', undef, '', "=for advent_title blah\n\nfoo mispelling bar", q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Pod::Advent 0.21 (Pod::Simple 3.13, Perl::Tidy 20090616) on 2010-12-02 17:26:37 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blah</title>
<link rel="stylesheet" href="foo.css" type="text/css" />
<link rel="alternate" type="text/plain" href="==TMPFILE==" />
</head>
<body>
<h1>blah</h1>
<p>foo mispelling bar</p>
<div style="float: right; font-size: 10pt"><a href="==TMPFILE==">View Source (POD)</a></div><br />
</body>
</html>}, [qw/--noadvent --css=foo.css --nospellcheck/] ],
[ '+', undef, 'Possible SPELLING ERRORS:
z1
', 'B<z1>', '<p><span style="font-weight: bold">z1</span></p>' ],
);
foreach my $info ( @files ){
my ( $podfile, $htmlfile, $errors, $stdin, $snippet, $args ) = @$info;
$args ||= [];
( run in 3.473 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )