From f9bb2fd12b9d7cad0e4dbaf252fcc291cb6aed51 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 15 Jun 2016 15:06:56 +0200 Subject: [PATCH] Skip pygmentize if the binary is not found --- t/pygmentize.t | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/t/pygmentize.t b/t/pygmentize.t index e71063c2..a46ba214 100644 --- a/t/pygmentize.t +++ b/t/pygmentize.t @@ -1,4 +1,4 @@ -# Copyright (C) 2015 Alex Schroeder +# Copyright (C) 2015-2016 Alex Schroeder # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -18,8 +18,14 @@ use Test::More tests => 2; add_module('pygmentize.pl'); -$ENV{PATH} = '.'; # pygmentize is not installed in the current directory -$page = apply_rules(newlines('{{{\ntest\n}}}\n')); -test_page($page, - '\bsh\b.*\bpygmentize\b.*\bnot found\b', - '
test
'); + SKIP: { + if (qx(pygmentize -V) !~ /Pygments version/) { + skip "pygmentize not found", 2; + } + + $ENV{PATH} = '.'; # pygmentize is not installed in the current directory + $page = apply_rules(newlines('{{{\ntest\n}}}\n')); + test_page($page, + '\bsh\b.*\bpygmentize\b.*\bnot found\b', + '
test
'); +}