Skip to content

Commit cb55e93

Browse files
instrumentation/faraday: use test adapter instead of webmock stub in tracing test
1 parent 8141981 commit cb55e93

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

instrumentation/faraday/test/opentelemetry/instrumentation/faraday_test.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,20 @@
5656
end
5757

5858
describe 'tracing' do
59-
before do
60-
stub_request(:any, 'example.com')
59+
let(:client) do
60+
Faraday.new('http://example.com') do |builder|
61+
builder.adapter(:test) do |stub|
62+
stub.get('/') { [200, {}, 'OK'] }
63+
end
64+
end
6165
end
6266

6367
it 'before request' do
6468
_(exporter.finished_spans.size).must_equal 0
6569
end
6670

6771
it 'after request' do
68-
Faraday.new('http://example.com').get('/')
72+
client.get('/')
6973

7074
_(exporter.finished_spans.size).must_equal 1
7175
end

0 commit comments

Comments
 (0)