From 20c06e6cc40ff498e12cc5a928919ce914ba9512 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Fri, 27 Mar 2009 13:05:30 +0100 Subject: skip tests when modules are not present --- t/02-xslt.t | 3 +-- t/03-html.t | 7 ++++++- t/04-xml.t | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/t/02-xslt.t b/t/02-xslt.t index 49e617a..88fb73e 100644 --- a/t/02-xslt.t +++ b/t/02-xslt.t @@ -5,6 +5,7 @@ BEGIN { eval 'use Tree::DAG_Node::XPath; require Tree::Transform::XSLTish'; plan skip_all => 'Tree::DAG_Node::XPath and Tree::Transform::XSLTish needed for this test' if $@; } +plan tests => 1; package Copy;{ use Tree::Transform::XSLTish; @@ -35,8 +36,6 @@ use warnings; use Tree::Template::Declare options => {builder => Tree::Template::Declare::DAG_Node->new('Tree::DAG_Node::XPath') }; use Data::Dumper; -plan tests=>1; - sub Tree::DAG_Node::XPath::Root::xpath_get_root_node { return $_[0] } sub Tree::DAG_Node::XPath::Root::xpath_get_parent_node { return } diff --git a/t/03-html.t b/t/03-html.t index 8504c90..27cac64 100644 --- a/t/03-html.t +++ b/t/03-html.t @@ -1,5 +1,10 @@ #!perl -use Test::Most 'no_plan','die'; +use Test::Most 'die'; +BEGIN { +eval 'use HTML::Element'; +plan skip_all => 'HTML::Element needed for this test' if $@; +} +plan tests => 1; use strict; use warnings; use Tree::Template::Declare options => {builder => '+HTML_Element'}; diff --git a/t/04-xml.t b/t/04-xml.t index 5281e46..9ec5924 100644 --- a/t/04-xml.t +++ b/t/04-xml.t @@ -1,5 +1,10 @@ #!perl -use Test::Most 'no_plan','die'; +use Test::Most 'die'; +BEGIN { +eval 'use XML::LibXML'; +plan skip_all => 'XML::LibXML needed for this test' if $@; +} +plan tests => 2; use strict; use warnings; use Tree::Template::Declare options => {builder => '+LibXML'}; -- cgit v1.2.3