@@ -7,7 +7,7 @@ use MetaCPAN::Server::Config ();
77use Test::More;
88
99my $config = MetaCPAN::Server::Config::config();
10- my %es = ( ' --es ' => $config -> {elasticsearch_servers }, ) ;
10+ $config -> { es } = $config -> {elasticsearch_servers };
1111
1212subtest ' create, delete index' => sub {
1313 subtest ' create index' => sub {
@@ -26,14 +26,14 @@ subtest 'create, delete index' => sub {
2626 ' --create_index' => ' mock_index' ,
2727 ' --patch_mapping' => $smockindexjson ,
2828 );
29- local @ARGV = ( ' mapping' , %args , %es );
29+ local @ARGV = ( ' mapping' , %args , );
3030 my $mapping = MetaCPAN::Script::Mapping-> new_with_options($config );
3131
3232 ok( $mapping -> run, " creation 'mock_index' succeeds" );
3333 is( $mapping -> exit_code, 0, " Exit Code '0' - No Error" );
3434 };
3535 subtest ' info shows new index' => sub {
36- local @ARGV = ( ' mapping' , ' --show_cluster_info' , %es , );
36+ local @ARGV = ( ' mapping' , ' --show_cluster_info' , );
3737 my $mapping = MetaCPAN::Script::Mapping-> new_with_options($config );
3838
3939 ok( $mapping -> run, " show info succeeds" );
@@ -44,14 +44,14 @@ subtest 'create, delete index' => sub {
4444 ' Created Index printed' );
4545 };
4646 subtest ' delete index' => sub {
47- local @ARGV = ( ' mapping' , ' --delete_index' , ' mock_index' , %es );
47+ local @ARGV = ( ' mapping' , ' --delete_index' , ' mock_index' , );
4848 my $mapping = MetaCPAN::Script::Mapping-> new_with_options($config );
4949
5050 ok( $mapping -> run, " deletion 'mock_index' succeeds" );
5151 is( $mapping -> exit_code, 0, " Exit Code '0' - No Error" );
5252 };
5353 subtest ' info does not show deleted index' => sub {
54- local @ARGV = ( ' mapping' , ' --show_cluster_info' , %es , );
54+ local @ARGV = ( ' mapping' , ' --show_cluster_info' , );
5555 my $mapping = MetaCPAN::Script::Mapping-> new_with_options($config );
5656
5757 ok( $mapping -> run, " show info succeeds" );
0 commit comments