Skip to content

Commit 4a1f1a5

Browse files
committed
[tests] change super to super() - jruby/jruby#6571
1 parent aeb60e2 commit 4a1f1a5

File tree

7 files changed

+50
-50
lines changed

7 files changed

+50
-50
lines changed

spec/integration/outputs/ilm_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
context 'with a policy with a maximum number of documents' do
66
let (:policy) { small_max_doc_policy }
77
let (:ilm_policy_name) { "logstash-policy-custom"}
8-
let (:settings) { super.merge("ilm_policy" => ilm_policy_name)}
8+
let (:settings) { super().merge("ilm_policy" => ilm_policy_name)}
99

1010
it 'should rollover when the policy max docs is reached' do
1111
put_policy(@es, ilm_policy_name, policy)
@@ -54,7 +54,7 @@
5454
context 'with a policy where the maximum number of documents is not reached' do
5555
let (:policy) { large_max_doc_policy }
5656
let (:ilm_policy_name) { "logstash-policy-custom-policy"}
57-
let (:settings) { super.merge("ilm_policy" => ilm_policy_name)}
57+
let (:settings) { super().merge("ilm_policy" => ilm_policy_name)}
5858

5959
it 'should ingest into a single index when max docs is not reached' do
6060
put_policy(@es,ilm_policy_name, policy)
@@ -119,7 +119,7 @@
119119
context 'with an existing policy that will roll over' do
120120
let (:policy) { small_max_doc_policy }
121121
let (:ilm_policy_name) { "logstash-policy-3_docs"}
122-
let (:settings) { super.merge("ilm_policy" => ilm_policy_name)}
122+
let (:settings) { super().merge("ilm_policy" => ilm_policy_name)}
123123

124124
it 'should not roll over indices' do
125125
subject.register
@@ -155,7 +155,7 @@
155155

156156
context 'with a custom template name' do
157157
let (:template_name) { "logstash_custom_template_name" }
158-
let (:settings) { super.merge('template_name' => template_name)}
158+
let (:settings) { super().merge('template_name' => template_name)}
159159

160160
it 'should not write the ILM settings into the template' do
161161
subject.register
@@ -195,7 +195,7 @@
195195
subject { LogStash::Outputs::ElasticSearch.new(settings) }
196196

197197
context 'when ilm is enabled in Logstash' do
198-
let (:settings) { super.merge!({ 'ilm_enabled' => true }) }
198+
let (:settings) { super().merge!({ 'ilm_enabled' => true }) }
199199

200200
it 'should raise a configuration error' do
201201
expect do
@@ -210,13 +210,13 @@
210210
end
211211

212212
context 'when ilm is disabled in Logstash' do
213-
let (:settings) { super.merge!({ 'ilm_enabled' => false }) }
213+
let (:settings) { super().merge!({ 'ilm_enabled' => false }) }
214214

215215
it_behaves_like 'an ILM disabled Logstash'
216216
end
217217

218218
context 'when ilm is set to auto in Logstash' do
219-
let (:settings) { super.merge!({ 'ilm_enabled' => 'auto' }) }
219+
let (:settings) { super().merge!({ 'ilm_enabled' => 'auto' }) }
220220

221221
it_behaves_like 'an ILM disabled Logstash'
222222
end
@@ -286,7 +286,7 @@
286286

287287
context 'when using the default policy' do
288288
context 'with a custom pattern' do
289-
let (:settings) { super.merge("ilm_pattern" => "000001")}
289+
let (:settings) { super().merge("ilm_pattern" => "000001")}
290290
it 'should create a rollover alias' do
291291
expect(@es.indices.exists_alias(name: "logstash")).to be_falsey
292292
subject.register
@@ -346,7 +346,7 @@
346346

347347
context 'when not using the default policy' do
348348
let (:ilm_policy_name) {"logstash-policy-small"}
349-
let (:settings) { super.merge("ilm_policy" => ilm_policy_name)}
349+
let (:settings) { super().merge("ilm_policy" => ilm_policy_name)}
350350
let (:policy) { small_max_doc_policy }
351351

352352
before do
@@ -363,7 +363,7 @@
363363

364364
context 'when using a time based policy' do
365365
let (:ilm_policy_name) {"logstash-policy-time"}
366-
let (:settings) { super.merge("ilm_policy" => ilm_policy_name)}
366+
let (:settings) { super().merge("ilm_policy" => ilm_policy_name)}
367367
let (:policy) { max_age_policy("1d") }
368368

369369
before do
@@ -409,7 +409,7 @@
409409
let (:template) { "spec/fixtures/template-with-policy-es6x.json" }
410410
end
411411

412-
let (:settings) { super.merge("template" => template,
412+
let (:settings) { super().merge("template" => template,
413413
"index" => "overwrite-4")}
414414

415415
it 'should not overwrite the index patterns' do
@@ -426,7 +426,7 @@
426426
let (:ilm_rollover_alias) { "logstash_the_cat_in_the_hat" }
427427
let (:index) { ilm_rollover_alias }
428428
let(:expected_index) { index }
429-
let (:settings) { super.merge("ilm_policy" => ilm_policy_name,
429+
let (:settings) { super().merge("ilm_policy" => ilm_policy_name,
430430
"template" => template,
431431
"ilm_rollover_alias" => ilm_rollover_alias)}
432432

@@ -480,7 +480,7 @@
480480

481481
context 'with a different template_name' do
482482
let (:template_name) { "logstash_custom_template_name" }
483-
let (:settings) { super.merge('template_name' => template_name)}
483+
let (:settings) { super().merge('template_name' => template_name)}
484484

485485
it_behaves_like 'an ILM enabled Logstash'
486486

@@ -514,7 +514,7 @@
514514
end
515515

516516
context 'when ilm_enabled is the default' do
517-
let (:settings) { super.tap{|x|x.delete('ilm_enabled')}}
517+
let (:settings) { super().tap{|x|x.delete('ilm_enabled')}}
518518

519519
if ESHelper.es_version_satisfies?(">=7.0")
520520
context 'when Elasticsearch is version 7 or above' do
@@ -530,13 +530,13 @@
530530
end
531531

532532
context 'with ilm disabled' do
533-
let (:settings) { super.merge('ilm_enabled' => false )}
533+
let (:settings) { super().merge('ilm_enabled' => false )}
534534

535535
it_behaves_like 'an ILM disabled Logstash'
536536
end
537537

538538
context 'with ilm disabled using a string' do
539-
let (:settings) { super.merge('ilm_enabled' => 'false' )}
539+
let (:settings) { super().merge('ilm_enabled' => 'false' )}
540540

541541
it_behaves_like 'an ILM disabled Logstash'
542542
end

spec/unit/http_client_builder_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040

4141
context "when setting bulk_path" do
4242
let(:bulk_path) { "/meh" }
43-
let(:options) { super.merge("bulk_path" => bulk_path) }
43+
let(:options) { super().merge("bulk_path" => bulk_path) }
4444

4545
context "when using path" do
46-
let(:options) { super.merge("path" => "/path") }
46+
let(:options) { super().merge("path" => "/path") }
4747
it "ignores the path setting" do
4848
expect(described_class).to receive(:create_http_client) do |options|
4949
expect(options[:bulk_path]).to eq(bulk_path)
@@ -66,7 +66,7 @@
6666

6767
context "when using path" do
6868
let(:path) { "/meh" }
69-
let(:options) { super.merge("path" => path) }
69+
let(:options) { super().merge("path" => path) }
7070
it "sets bulk_path to path+_bulk" do
7171
expect(described_class).to receive(:create_http_client) do |options|
7272
expect(options[:bulk_path]).to eq("#{path}/_bulk")
@@ -88,10 +88,10 @@
8888
describe "healthcheck_path" do
8989
context "when setting healthcheck_path" do
9090
let(:healthcheck_path) { "/meh" }
91-
let(:options) { super.merge("healthcheck_path" => healthcheck_path) }
91+
let(:options) { super().merge("healthcheck_path" => healthcheck_path) }
9292

9393
context "when using path" do
94-
let(:options) { super.merge("path" => "/path") }
94+
let(:options) { super().merge("path" => "/path") }
9595
it "ignores the path setting" do
9696
expect(described_class).to receive(:create_http_client) do |options|
9797
expect(options[:healthcheck_path]).to eq(healthcheck_path)
@@ -114,7 +114,7 @@
114114

115115
context "when using path" do
116116
let(:path) { "/meh" }
117-
let(:options) { super.merge("path" => path) }
117+
let(:options) { super().merge("path" => path) }
118118
it "sets healthcheck_path to path" do
119119
expect(described_class).to receive(:create_http_client) do |options|
120120
expect(options[:healthcheck_path]).to eq(path)
@@ -136,10 +136,10 @@
136136
describe "sniffing_path" do
137137
context "when setting sniffing_path" do
138138
let(:sniffing_path) { "/meh" }
139-
let(:options) { super.merge("sniffing_path" => sniffing_path) }
139+
let(:options) { super().merge("sniffing_path" => sniffing_path) }
140140

141141
context "when using path" do
142-
let(:options) { super.merge("path" => "/path") }
142+
let(:options) { super().merge("path" => "/path") }
143143
it "ignores the path setting" do
144144
expect(described_class).to receive(:create_http_client) do |options|
145145
expect(options[:sniffing_path]).to eq(sniffing_path)
@@ -162,7 +162,7 @@
162162

163163
context "when using path" do
164164
let(:path) { "/meh" }
165-
let(:options) { super.merge("path" => path) }
165+
let(:options) { super().merge("path" => path) }
166166
it "sets sniffing_path to path+_nodes/http" do
167167
expect(described_class).to receive(:create_http_client) do |options|
168168
expect(options[:sniffing_path]).to eq("#{path}/_nodes/http")

spec/unit/outputs/elasticsearch/http_client/pool_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
context "and setting healthcheck_path" do
7070
let(:healthcheck_path) { "/my/health" }
71-
let(:options) { super.merge(:healthcheck_path => healthcheck_path) }
71+
let(:options) { super().merge(:healthcheck_path => healthcheck_path) }
7272
it "performs the healthcheck to the healthcheck_path" do
7373
expect(adapter).to receive(:perform_request) do |url, method, req_path, _, _|
7474
expect(method).to eq(:head)
@@ -130,7 +130,7 @@
130130
end
131131

132132
context "when enabled" do
133-
let(:options) { super.merge(:sniffing => true)}
133+
let(:options) { super().merge(:sniffing => true)}
134134

135135
it "should start the sniffer" do
136136
expect(subject.sniffer_alive?).to eql(true)
@@ -247,7 +247,7 @@
247247
end
248248

249249
let(:options) do
250-
super.merge(:license_checker => license_checker)
250+
super().merge(:license_checker => license_checker)
251251
end
252252

253253
context 'when LicenseChecker#acceptable_license? returns false' do

spec/unit/outputs/elasticsearch/http_client_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
describe "ssl" do
4949
context "when SSL is true" do
5050
let(:ssl) { true }
51-
let(:base_options) { super.merge(:hosts => [http_hostname_port]) }
51+
let(:base_options) { super().merge(:hosts => [http_hostname_port]) }
5252

5353
it "should refuse to handle an http url" do
5454
expect {
@@ -59,7 +59,7 @@
5959

6060
context "when SSL is false" do
6161
let(:ssl) { false }
62-
let(:base_options) { super.merge(:hosts => [https_hostname_port]) }
62+
let(:base_options) { super().merge(:hosts => [https_hostname_port]) }
6363

6464
it "should refuse to handle an https url" do
6565
expect {
@@ -69,7 +69,7 @@
6969
end
7070

7171
describe "ssl is nil" do
72-
let(:base_options) { super.merge(:hosts => [https_hostname_port]) }
72+
let(:base_options) { super().merge(:hosts => [https_hostname_port]) }
7373
it "should handle an ssl url correctly when SSL is nil" do
7474
subject
7575
expect(subject.host_to_url(https_hostname_port).to_s).to eq(https_hostname_port.to_s + "/")
@@ -79,14 +79,14 @@
7979

8080
describe "path" do
8181
let(:url) { http_hostname_port_path }
82-
let(:base_options) { super.merge(:hosts => [url]) }
82+
let(:base_options) { super().merge(:hosts => [url]) }
8383

8484
it "should allow paths in a url" do
8585
expect(subject.host_to_url(url)).to eq(url)
8686
end
8787

8888
context "with the path option set" do
89-
let(:base_options) { super.merge(:client_settings => {:path => "/otherpath"}) }
89+
let(:base_options) { super().merge(:client_settings => {:path => "/otherpath"}) }
9090

9191
it "should not allow paths in two places" do
9292
expect {
@@ -97,7 +97,7 @@
9797

9898
context "with a path missing a leading /" do
9999
let(:url) { http_hostname_port }
100-
let(:base_options) { super.merge(:client_settings => {:path => "otherpath"}) }
100+
let(:base_options) { super().merge(:client_settings => {:path => "otherpath"}) }
101101

102102

103103
it "should automatically insert a / in front of path overlays" do

spec/unit/outputs/elasticsearch_proxy_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
context "when specified as a URI" do
2626
shared_examples("hash conversion") do |hash|
27-
let(:settings) { super.merge("proxy" => proxy)}
27+
let(:settings) { super().merge("proxy" => proxy)}
2828

2929
it "should set the proxy to the correct hash value" do
3030
expect(::Manticore::Client).to have_received(:new) do |options|
@@ -71,7 +71,7 @@
7171
end
7272

7373
context "when specified as ''" do
74-
let(:settings) { super.merge("proxy" => "${A_MISSING_ENV_VARIABLE:}")}
74+
let(:settings) { super().merge("proxy" => "${A_MISSING_ENV_VARIABLE:}")}
7575

7676
it "should not send the proxy option to manticore" do
7777
expect { subject.register }.not_to raise_error
@@ -85,7 +85,7 @@
8585
end
8686

8787
context "when specified as invalid uri" do
88-
let(:settings) { super.merge("proxy" => ":")}
88+
let(:settings) { super().merge("proxy" => ":")}
8989

9090
it "should fail" do
9191
# SafeURI isn't doing the proper exception wrapping for us, we can not simply :

0 commit comments

Comments
 (0)