ASPEER-MakeMaker-Markdown-Pod
view release on metacpan or search on metacpan
t/04-mm-readme.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use lib 'lib';
use Cwd qw(getcwd);
use File::Path qw(make_path);
use File::Temp qw(tempdir);
use Test::More;
use ASPEER::MakeMaker::Markdown::Pod::Constant;
use ASPEER::MakeMaker::Markdown::Pod::MM;
plan skip_all => 'pandoc is required for README generation tests'
unless $PANDOC_EXE;
sub slurp {
my ($fn)=@_;
open(my $fh, '<', $fn) || die "unable to open $fn, $!";
local $/=undef;
my $text=<$fh>;
close($fh) || die "unable to close $fn, $!";
return $text;
}
sub spew {
my ($fn, $content)=@_;
open(my $fh, '>', $fn) || die "unable to open $fn, $!";
print $fh $content;
close($fh) || die "unable to close $fn, $!";
}
sub run_readme {
my ($version_from)=@_;
return ASPEER::MakeMaker::Markdown::Pod::MM::readme(
undef,
'',
'',
'',
'',
'',
'',
$version_from,
'',
'',
'',
'',
'',
'',
'',
);
}
sub start_fixture {
my ($cwd)=@_;
chdir($cwd) || die "unable to chdir $cwd, $!";
my $temporary_dn=tempdir(CLEANUP => 1);
chdir($temporary_dn) || die "unable to chdir $temporary_dn, $!";
( run in 1.575 second using v1.01-cache-2.11-cpan-234fa220139 )