Skip to content

Commit 78640ef

Browse files
committed
Remove ethon thread helper in test suite
1 parent 23debfe commit 78640ef

File tree

5 files changed

+9
-38
lines changed

5 files changed

+9
-38
lines changed

spec/datadog/tracing/contrib/ethon/easy_patch_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
require 'datadog/tracing/contrib/ethon/shared_examples'
77
require 'datadog/tracing/contrib/analytics_examples'
88

9-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
10-
119
RSpec.describe Datadog::Tracing::Contrib::Ethon::EasyPatch do
1210
let(:configuration_options) { {} }
13-
let(:easy) { EthonSupport.ethon_easy_new }
11+
let(:easy) { Ethon::Easy.new }
1412
let(:server_error_statuses) { nil }
1513

1614
before do
@@ -252,7 +250,7 @@
252250

253251
context 'when basic auth in url' do
254252
it 'does not collect auth info' do
255-
easy = EthonSupport.ethon_easy_new(url: 'http://username:[email protected]/sample/path')
253+
easy = Ethon::Easy.new(url: 'http://username:[email protected]/sample/path')
256254

257255
easy.perform
258256

@@ -263,7 +261,7 @@
263261

264262
context 'when query string in url' do
265263
it 'does not collect query string' do
266-
easy = EthonSupport.ethon_easy_new(url: 'http://example.com/sample/path?foo=bar')
264+
easy = Ethon::Easy.new(url: 'http://example.com/sample/path?foo=bar')
267265

268266
easy.perform
269267

spec/datadog/tracing/contrib/ethon/integration_test_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
require 'datadog/tracing/contrib/support/spec_helper'
1010
require 'datadog/tracing/contrib/support/http'
1111

12-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
13-
1412
RSpec.describe 'Ethon integration tests' do
1513
skip_unless_integration_testing_enabled
1614

1715
context 'with Easy HTTP request' do
1816
subject(:request) do
19-
easy = EthonSupport.ethon_easy_new
17+
easy = Ethon::Easy.new
2018
easy.http_request(url, 'GET', params: query, timeout_ms: timeout * 1000)
2119
easy.perform
2220
# Use Typhoeus response wrapper to simplify tests
@@ -67,7 +65,7 @@
6765

6866
context 'with simple Easy & headers override' do
6967
subject(:request) do
70-
easy = EthonSupport.ethon_easy_new(url: url)
68+
easy = Ethon::Easy.new(url: url)
7169
easy.customrequest = 'GET'
7270
easy.set_attributes(timeout_ms: timeout * 1000)
7371
easy.headers = request_headers
@@ -104,7 +102,7 @@
104102
context 'with single Multi request' do
105103
subject(:request) do
106104
multi = Ethon::Multi.new
107-
easy = EthonSupport.ethon_easy_new
105+
easy = Ethon::Easy.new
108106
easy.http_request(url, 'GET', params: query, timeout_ms: timeout * 1000)
109107
multi.add(easy)
110108
multi.perform

spec/datadog/tracing/contrib/ethon/multi_patch_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
require 'datadog/tracing/contrib/environment_service_name_examples'
88
require 'datadog/tracing/contrib/span_attribute_schema_examples'
99

10-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
11-
1210
RSpec.describe Datadog::Tracing::Contrib::Ethon::MultiPatch do
1311
let(:configuration_options) { {} }
1412

@@ -26,7 +24,7 @@
2624
end
2725

2826
describe '#add' do
29-
let(:easy) { EthonSupport.ethon_easy_new }
27+
let(:easy) { Ethon::Easy.new }
3028
let(:span) { easy.instance_eval { @datadog_span } }
3129
let(:multi_span) { multi.instance_eval { @datadog_multi_span } }
3230
let(:multi) { ::Ethon::Multi.new }
@@ -61,7 +59,7 @@
6159
end
6260

6361
describe '#perform' do
64-
let(:easy) { EthonSupport.ethon_easy_new }
62+
let(:easy) { Ethon::Easy.new }
6563
let(:easy_span) { spans.find { |span| span.name == 'ethon.request' } }
6664
let(:multi_span) { spans.find { |span| span.name == 'ethon.multi.request' } }
6765
let(:multi) { ::Ethon::Multi.new }

spec/datadog/tracing/contrib/ethon/support/thread_helpers.rb

Lines changed: 0 additions & 22 deletions
This file was deleted.

spec/datadog/tracing/contrib/ethon/typhoeus_integration_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require 'datadog/tracing/contrib/ethon/shared_examples'
44
require 'datadog/tracing/contrib/ethon/integration_context'
5-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
65

76
RSpec.describe Datadog::Tracing::Contrib::Ethon do
87
skip_unless_integration_testing_enabled
@@ -18,7 +17,7 @@
1817
#
1918
# This allows us to still ensure that the integration
2019
# itself is leak-free.
21-
EthonSupport.ethon_easy_new
20+
Ethon::Easy.new
2221
end
2322

2423
context 'with Typhoeus request' do

0 commit comments

Comments
 (0)