From: Rafael Kitover Date: Mon, 4 Jul 2011 14:16:51 +0000 (-0400) Subject: add XML::NamespaceSupport to XML format deps, silence YAML warnings in tests X-Git-Tag: v0.22~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e7be073ac39914776ae469d6d1b51b666f6210d5;p=p5sagit%2FConfig-Any.git add XML::NamespaceSupport to XML format deps, silence YAML warnings in tests --- diff --git a/lib/Config/Any/XML.pm b/lib/Config/Any/XML.pm index ee5be5c..844d76b 100644 --- a/lib/Config/Any/XML.pm +++ b/lib/Config/Any/XML.pm @@ -76,11 +76,12 @@ sub _coerce { =head2 requires_all_of( ) -Specifies that this module requires L in order to work. +Specifies that this module requires L and L +in order to work. =cut -sub requires_all_of { 'XML::Simple' } +sub requires_all_of { 'XML::Simple', 'XML::NamespaceSupport' } =head1 CAVEATS diff --git a/lib/Config/Any/YAML.pm b/lib/Config/Any/YAML.pm index 8efee77..a12c74f 100644 --- a/lib/Config/Any/YAML.pm +++ b/lib/Config/Any/YAML.pm @@ -41,6 +41,8 @@ Attempts to load C<$file> as a YAML file. =cut +our $NO_YAML_XS_WARNING; + sub load { my $class = shift; my $file = shift; @@ -52,7 +54,8 @@ sub load { Carp::carp 'Use of YAML::Syck or YAML to parse config files is DEPRECATED. ' - . 'Please install YAML::XS for proper YAML support'; + . 'Please install YAML::XS for proper YAML support' + unless $NO_YAML_XS_WARNING; eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) }; unless ( $@ ) { diff --git a/t/10-branches.t b/t/10-branches.t index d00377b..96d4cab 100644 --- a/t/10-branches.t +++ b/t/10-branches.t @@ -1,10 +1,14 @@ use strict; use warnings; +no warnings 'once'; # use Test::Without::Module qw(YAML YAML::Syck Config::General XML::Simple JSON JSON::Syck Config::Tiny ); -use Test::More tests => 10; +use Test::More tests => 11; use_ok( 'Config::Any' ); +use_ok( 'Config::Any::YAML' ); + +$Config::Any::YAML::NO_YAML_XS_WARNING = 1; { my @warnings; diff --git a/t/20-parse.t b/t/20-parse.t index 47d38e7..cf07aa0 100644 --- a/t/20-parse.t +++ b/t/20-parse.t @@ -1,6 +1,7 @@ package MockApp; use strict; use warnings; +no warnings 'once'; $|++; use Test::More tests => 54; @@ -13,6 +14,8 @@ use Config::Any::Perl; use Config::Any::XML; use Config::Any::YAML; +$Config::Any::YAML::NO_YAML_XS_WARNING = 1; + our %ext_map = ( conf => 'Config::Any::General', ini => 'Config::Any::INI', diff --git a/t/55-yaml.t b/t/55-yaml.t index 5a020bb..caf6f66 100644 --- a/t/55-yaml.t +++ b/t/55-yaml.t @@ -1,9 +1,12 @@ use strict; use warnings; +no warnings 'once'; use Test::More; use Config::Any::YAML; +$Config::Any::YAML::NO_YAML_XS_WARNING = 1; + if ( !Config::Any::YAML->is_supported ) { plan skip_all => 'YAML format not supported'; } diff --git a/t/62-multi.t b/t/62-multi.t index df57486..7ac9f8c 100644 --- a/t/62-multi.t +++ b/t/62-multi.t @@ -1,11 +1,14 @@ use strict; use warnings; +no warnings 'once'; use Test::More tests => 3; use Config::Any; use Config::Any::YAML; +$Config::Any::YAML::NO_YAML_XS_WARNING = 1; + my $file = 't/multi/conf.yml'; my @expect = ( { name => 'TestApp',