diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-11-17 14:22:11 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-11-17 14:22:11 -0500 |
commit | 43039d7d86ea66578743867a0b1d484e65816bb2 (patch) | |
tree | 321321f22f0157badb1d1198cc6b6f364de3d3dc | |
parent | e8a945845bd0774c2280da53f8a976c48547ede4 (diff) |
modify to skip tests if the neccessary perl modules are not available
-rwxr-xr-x | t/htmlbalance.t | 15 |
1 files changed, 13 insertions, 2 deletions
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 => "<br></br>"), "<br />"); is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<div><p b=\"c\">hello world</div>"), "<div><p b=\"c\">hello world</p></div>"); |