From: Joey Hess Date: Mon, 17 Nov 2008 19:22:11 +0000 (-0500) Subject: modify to skip tests if the neccessary perl modules are not available X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/43039d7d86ea66578743867a0b1d484e65816bb2?ds=sidebyside modify to skip tests if the neccessary perl modules are not available --- diff --git a/t/htmlbalance.t b/t/htmlbalance.t index cd124e473..783ed9841 100755 --- a/t/htmlbalance.t +++ b/t/htmlbalance.t @@ -1,9 +1,20 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 7; -BEGIN { use_ok("IkiWiki::Plugin::htmlbalance"); } +BEGIN { + eval q{ + use HTML::TreeBuilder; + use XML::Atom::Util qw(encode_xml); + }; + if ($@) { + eval q{use Test::More skip_all => "HTML::TreeBuilder or XML::Atom::Util not available"}; + } + else { + eval q{use Test::More tests => 7}; + } + use_ok("IkiWiki::Plugin::htmlbalance"); +} is(IkiWiki::Plugin::htmlbalance::sanitize(content => "

"), "
"); is(IkiWiki::Plugin::htmlbalance::sanitize(content => "

hello world

"), "

hello world

");