Skip to content

Commit e97ca95

Browse files
committed
fix metacpan/MetaCPAN-Client#122 with a monkeypatch
1 parent b876d59 commit e97ca95

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

xt/dependent-modules.t

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@ use Test2::V0;
22
use strictures 2;
33

44
use Test::DependentModules 'test_all_dependents';
5+
use MetaCPAN::Client;
56

67
skip_all "ENV var TEST_DEPENDENTS not set" if not $ENV{TEST_DEPENDENTS};
78

89
# duplicate error output into an array for later printing
910
my @error_log;
10-
my $old = \&Test::DependentModules::_error_log;
11-
my $new = sub { push @error_log, @_; $old->(@_); };
12-
{ no warnings 'redefine'; *Test::DependentModules::_error_log = $new; }
11+
my $old_log = \&Test::DependentModules::_error_log;
12+
my $new_log = sub { push @error_log, @_; $old_log->(@_); };
13+
{ no warnings 'redefine'; *Test::DependentModules::_error_log = $new_log; }
14+
15+
# force metacpan to actually return the whole dependents list
16+
# https://github.com/metacpan/metacpan-client/issues/122
17+
my $old_fetch = \&MetaCPAN::Client::fetch;
18+
my $new_fetch = sub { $old_fetch->( shift, shift . "?size=5000", @_ ) };
19+
{ no warnings 'redefine'; *MetaCPAN::Client::fetch = $new_fetch; }
1320

1421
test_all_dependents PPI => {
1522
exclude => qr/^(

0 commit comments

Comments
 (0)