]> Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blobdiff - t/00-report-prereqs.t
Version 0.009
[chaz/p5-Dist-Zilla-PluginBundle-Author-CCM] / t / 00-report-prereqs.t
index e338372ff6d5e48f6b4d012d807abb4614c79161..c72183a1bebf16b344dc1a660fee5207cee16e05 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.025
+# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027
 
 use Test::More tests => 1;
 
@@ -68,7 +68,7 @@ my @exclude = qw(
 );
 
 # Add static prereqs to the included modules list
-my $static_prereqs = do 't/00-report-prereqs.dd';
+my $static_prereqs = do './t/00-report-prereqs.dd';
 
 # Merge all prereqs (either with ::Prereqs or a hashref)
 my $full_prereqs = _merge_prereqs(
@@ -78,12 +78,14 @@ my $full_prereqs = _merge_prereqs(
 
 # Add dynamic prereqs to the included modules list (if we can)
 my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
+my $cpan_meta_error;
 if ( $source && $HAS_CPAN_META
     && (my $meta = eval { CPAN::Meta->load_file($source) } )
 ) {
     $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
 }
 else {
+    $cpan_meta_error = $@;    # capture error from CPAN::Meta->load_file($source)
     $source = 'static metadata';
 }
 
@@ -169,10 +171,18 @@ if ( @full_reports ) {
     diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
 }
 
+if ( $cpan_meta_error || @dep_errors ) {
+    diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n";
+}
+
+if ( $cpan_meta_error ) {
+    my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
+    diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n";
+}
+
 if ( @dep_errors ) {
     diag join("\n",
-        "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n",
-        "The following REQUIRED prerequisites were not satisfied:\n",
+        "\nThe following REQUIRED prerequisites were not satisfied:\n",
         @dep_errors,
         "\n"
     );
This page took 0.023776 seconds and 4 git commands to generate.