Pod-Pandoc

 view release on metacpan or  search on metacpan

t/app-pod2pandoc-meta.t  view on Meta::CPAN

use File::Temp qw(tempfile);
use App::pod2pandoc;
use Pandoc::Elements;

plan skip_all => 'these tests are for release candidate testing'
  unless $ENV{RELEASE_TESTING};

sub pod2meta {
    my ( $fh, $file ) = tempfile;
    pod2pandoc ['script/pod2pandoc'], {@_}, '-t' => 'json', '-o', $file;
    my $json = do { local ( @ARGV, $/ ) = $file; <> };
    pandoc_json($json)->metavalue;
}

my $expect = {
    file     => 'script/pod2pandoc',
    subtitle => 'convert Pod to Pandoc document model',
    title    => 'pod2pandoc'
};

is_deeply pod2meta(), $expect, 'no meta';

t/app-pod2pandoc.t  view on Meta::CPAN

use App::pod2pandoc;
use File::Temp qw(tempdir);
use File::Spec::Functions;
use Test::Output qw(:functions);
use JSON;

plan skip_all => 'these tests are for release candidate testing'
  unless $ENV{RELEASE_TESTING};

my $dir = tempdir( CLEANUP => 1 );
sub slurp { local ( @ARGV, $/ ) = @_; <> }

# convert a single file
{
    my @source = 'lib/Pod/Pandoc.pm';
    my $target = catfile( $dir, 'Pandoc-Elements.html' );
    my @args = ('--template' => 't/template.html'); 
    is stdout_from { pod2pandoc( \@source, -o => $target, @args ) }, '';

    is slurp($target),
      "Pod::Pandoc: process Plain Old Documentation format with Pandoc\n"



( run in 0.606 second using v1.01-cache-2.11-cpan-49f99fa48dc )