- local *UNIVERSAL::TO_JSON = sub { +{ %{$_[0]} } };
- my $json = JSON::PP->new->ascii->pretty->canonical->allow_unknown->allow_blessed->convert_blessed;
- my $data = $json->encode(\%bad);
+ my $data;
+ my $ok = eval {
+ require JSON::PP;
+ local *UNIVERSAL::TO_JSON = sub { +{ %{$_[0]} } };
+ my $json = JSON::PP->new->ascii->pretty->canonical->allow_unknown->allow_blessed->convert_blessed;
+ $data = $json->encode(\%bad);
+ 1;
+ };
+ $ok ||= eval {
+ require Data::Dumper;
+ local $Data::Dumper::Sortkeys = 1;
+ $data = Data::Dumper::Dumper(\%bad);
+ 1;
+ };
+
+ $data = "Could not dump data... sorry." unless defined $data;
$self->abort_trace("Not all files from hub '$hid' have been collected!\nHere is the leftover data:\n========================\n$data\n===================\n");
}
$self->abort_trace("Not all files from hub '$hid' have been collected!\nHere is the leftover data:\n========================\n$data\n===================\n");
@@ -33,12+33,12 @@ for my $meth (qw/upgrade_suggested upgrade_required known_broken/) {
{
local %INC = (
%INC,
{
local %INC = (
%INC,
- 'T2Test/UG1.pm' => 1,
- 'T2Test/UG2.pm' => 1,
- 'T2Test/UR1.pm' => 1,
- 'T2Test/UR2.pm' => 1,
- 'T2Test/KB1.pm' => 1,
- 'T2Test/KB2.pm' => 1,
+ 'T2Test/UG1.pm' => 'T2Test/UG1.pm',
+ 'T2Test/UG2.pm' => 'T2Test/UG2.pm',
+ 'T2Test/UR1.pm' => 'T2Test/UR1.pm',
+ 'T2Test/UR2.pm' => 'T2Test/UR2.pm',
+ 'T2Test/KB1.pm' => 'T2Test/KB1.pm',
+ 'T2Test/KB2.pm' => 'T2Test/KB2.pm',
);
local $T2Test::UG1::VERSION = '0.9';
local $T2Test::UG2::VERSION = '0.9';
);
local $T2Test::UG1::VERSION = '0.9';
local $T2Test::UG2::VERSION = '0.9';
@@ -49,14+49,16 @@ for my $meth (qw/upgrade_suggested upgrade_required known_broken/) {
my @report = $CLASS->report;
my @report = $CLASS->report;
+ $_ =~ s{\S+/Breakage\.pm}{Breakage.pm}g for @report;
+
is_deeply(
[sort @report],
[
sort
is_deeply(
[sort @report],
[
sort
- " * Module 'T2Test::UG1' is outdated, we recommend updating above 1.0.",
" * Module 'T2Test::UR1' is outdated and known to be broken, please update to 1.0 or higher.",
" * Module 'T2Test::KB1' is known to be broken in version 1.0 and below, newer versions have not been tested. You have: 0.9",
" * Module 'T2Test::KB2' is known to be broken in version 0.5 and below, newer versions have not been tested. You have: 0.9",
" * Module 'T2Test::UR1' is outdated and known to be broken, please update to 1.0 or higher.",
" * Module 'T2Test::KB1' is known to be broken in version 1.0 and below, newer versions have not been tested. You have: 0.9",
" * Module 'T2Test::KB2' is known to be broken in version 0.5 and below, newer versions have not been tested. You have: 0.9",
+ " * Module 'T2Test::UG1' is outdated, we recommed updating above 1.0. error was: 'T2Test::UG1 version 1.0 required--this is only version 0.9 at Breakage.pm line 75.'; INC is T2Test/UG1.pm",