Skip to content
Browse files

fix test bug with Test::NoWarning under 5.10.0 and File::Slurp 9999.19

  • Loading branch information...
1 parent 60a1871 commit 729b5e04f045ccd62e7ef6560e4435432d65f0f8 @harleypig committed Feb 9, 2012
Showing with 34 additions and 3 deletions.
  1. +34 −3 t/100-basic.t
View
37 t/100-basic.t
@@ -1,10 +1,41 @@
-use Test::Most tests => 32;
-use Test::NoWarnings; # use ':early' to debug test
+use Test::Most;
use Test::File;
use Test::File::Contents;
-BEGIN { use_ok( 'Config::NameValue' ) }
+# http://www.cpantesters.org/cpan/report/f0925d72-3e45-11e1-a48f-e7fb434ae6f1
+# perl 5.10.0 and File::Slurp 9999.19 has errors that cause NoWarnings to fail
+
+# Is there a better way to do this?
+
+BEGIN {
+
+ eval "require File::Slurp";
+
+ die "File::Slurp is not installed"
+ if $@;
+
+ my $fs_ver = $File::Slurp::VERSION;
+
+ my $tests = 32;
+
+ if ( $] eq '5.010000' && $fs_ver eq '9999.19' ) {
+
+ note( 'Perl 5.10.0 and File::Slurp 9999.19 cause problems with Test::NoWarnings, not testing for warnings' );
+ $tests--;
+
+ } else {
+
+ require Test::NoWarnings;
+ Test::NoWarnings->import();
+
+ }
+
+ plan tests => $tests;
+
+ use_ok( 'Config::NameValue' );
+
+}
my $test_config = 't/test.config';
my $new_config = 't/temp.test.config';

0 comments on commit 729b5e0

Please sign in to comment.
Something went wrong with that request. Please try again.