summaryrefslogtreecommitdiff
path: root/t/spin/markdown.t
diff options
context:
space:
mode:
Diffstat (limited to 't/spin/markdown.t')
-rwxr-xr-xt/spin/markdown.t24
1 files changed, 7 insertions, 17 deletions
diff --git a/t/spin/markdown.t b/t/spin/markdown.t
index bf8de61..7b36e9f 100755
--- a/t/spin/markdown.t
+++ b/t/spin/markdown.t
@@ -2,7 +2,7 @@
#
# Test Markdown conversion.
#
-# Copyright 2021 Russ Allbery <rra@cpan.org>
+# Copyright 2021-2022 Russ Allbery <rra@cpan.org>
#
# SPDX-License-Identifier: MIT
@@ -14,10 +14,8 @@ use lib 't/lib';
use Capture::Tiny qw(capture_stdout);
use Carp qw(croak);
-use Cwd qw(getcwd);
-use File::Copy::Recursive qw(dircopy);
-use File::Temp ();
use IPC::Cmd qw(can_run);
+use Path::Tiny qw(path);
use Test::DocKnot::Spin qw(is_spin_output_tree);
use Template ();
@@ -35,21 +33,13 @@ local $ENV{XDG_CONFIG_DIRS} = '/nonexistent';
require_ok('App::DocKnot::Spin');
require_ok('App::DocKnot::Spin::Pointer');
-# Ensure Devel::Cover has loaded the HTML template before we start changing
-# the working directory with File::Find. (This is a dumb workaround, but I
-# can't find a better one; +ignore doesn't work.)
-my $pointer = App::DocKnot::Spin::Pointer->new();
-my $template = $pointer->appdata_path('templates', 'html.tmpl');
-my $tt = Template->new({ ABSOLUTE => 1 }) or croak(Template->error());
-$tt->process($template, {}, \my $result);
-
# Spin the tree of files and check the result.
-my $datadir = File::Spec->catfile('t', 'data', 'spin', 'markdown');
-my $input = File::Spec->catfile($datadir, 'input');
-my $output = File::Temp->newdir();
-my $expected = File::Spec->catfile($datadir, 'output');
+my $datadir = path('t', 'data', 'spin', 'markdown');
+my $input = $datadir->child('input');
+my $output = Path::Tiny->tempdir();
+my $expected = $datadir->child('output');
my $spin = App::DocKnot::Spin->new({ 'style-url' => '/~eagle/styles/' });
-my $stdout = capture_stdout { $spin->spin($input, $output->dirname) };
+my $stdout = capture_stdout { $spin->spin($input, $output) };
my $count = is_spin_output_tree($output, $expected, 'spin');
# Report the end of testing.