better diagnostics on test failures
[p5sagit/Config-Any.git] / t / 20-parse.t
index 47d38e7..e1696a9 100644 (file)
@@ -1,9 +1,9 @@
 package MockApp;
 use strict;
 use warnings;
+no warnings 'once';
 
-$|++;
-use Test::More tests => 54;
+use Test::More tests => 6*9;
 use Scalar::Util qw(blessed reftype);
 use Config::Any;
 use Config::Any::General;
@@ -28,17 +28,12 @@ sub load_parser_for {
 
     my ( $ext ) = $f =~ m{ \. ( [^\.]+ ) \z }xms;
     my $mod = $ext_map{ $ext };
-    my $mod_load_result;
-    eval {
-        $mod_load_result = $mod->load( $f );
-        delete $INC{ $f } if $ext eq 'pl';
-    };
-    return $@ ? ( 1, $mod ) : ( 0, $mod );
+    return !$mod->is_supported ? ( 1, $mod ) : ( 0, $mod );
 }
 
 for my $f ( map { "t/conf/conf.$_" } keys %ext_map ) {
     my ( $skip, $mod ) = load_parser_for( $f );
-SKIP: {
+    SKIP: {
         skip "File loading backend for $mod not found", 9 if $skip;
 
         ok( my $c_arr