Skip to content

Commit

Permalink
update test to set correct transport object
Browse files Browse the repository at this point in the history
  • Loading branch information
ekump committed Jan 26, 2024
1 parent 26b6bf8 commit 821f631
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/datadog/tracing/contrib/elasticsearch/transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,17 @@ def call(env)
end
end

describe 'client configuration override' do
describe 'transport configuration override' do
context 'when #service is overridden' do
before { Datadog.configure_onto(client.transport, service_name: service_name) }
let(:version_greater_than_8) { Gem::Version.new(::Elasticsearch::VERSION) >= Gem::Version.new('8.0.0') }

before do
if version_greater_than_8
Datadog.configure_onto(client.transport, service_name: service_name)
else
Datadog.configure_onto(client.transport.transport, service_name: service_name)
end
end

let(:service_name) { 'bar' }

Expand Down

0 comments on commit 821f631

Please sign in to comment.