Skip to content

Commit eb84171

Browse files
committed
testserver: get mapping via esconfig
1 parent b01e1fd commit eb84171

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/lib/MetaCPAN/TestServer.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package MetaCPAN::TestServer;
22

33
use MetaCPAN::Moose;
44

5+
use Cpanel::JSON::XS qw( encode_json );
6+
use MetaCPAN::ESConfig qw( es_config );
57
use MetaCPAN::Script::Author ();
68
use MetaCPAN::Script::Cover ();
79
use MetaCPAN::Script::CPANTestersAPI ();
@@ -283,7 +285,7 @@ sub test_index_missing {
283285
my $self = $_[0];
284286

285287
subtest 'missing index' => sub {
286-
my $scoverindexjson = MetaCPAN::Script::Mapping::Cover::mapping;
288+
my $cover_mapping_json = encode_json( es_config->mapping('cover') );
287289

288290
subtest 'delete cover index' => sub {
289291
local @ARGV = qw(mapping --delete_index cover);
@@ -298,7 +300,7 @@ sub test_index_missing {
298300
local @ARGV = (
299301
'mapping', '--create_index',
300302
'cover', '--patch_mapping',
301-
qq({ "cover": $scoverindexjson })
303+
qq({ "cover": $cover_mapping_json })
302304
);
303305
my $mapping
304306
= MetaCPAN::Script::Mapping->new_with_options(

0 commit comments

Comments
 (0)