From d49cd45ac7269940498db0c2164de7b94a440ea5 Mon Sep 17 00:00:00 2001 From: Andrei Makarenko Date: Fri, 10 May 2024 16:09:19 +0200 Subject: [PATCH] fix rubocop --- spec/elastic_apm/spies/sidekiq_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/elastic_apm/spies/sidekiq_spec.rb b/spec/elastic_apm/spies/sidekiq_spec.rb index c15b0b18f..2ff0674c9 100644 --- a/spec/elastic_apm/spies/sidekiq_spec.rb +++ b/spec/elastic_apm/spies/sidekiq_spec.rb @@ -132,15 +132,15 @@ def perform transaction = ElasticAPM.start_transaction 'Test' ElasticAPM.end_transaction - fake_trace_context = transaction.trace_context - - allow_any_instance_of(ElasticAPM::Spies::SidekiqSpy::Middleware).to receive(:get_trace_context_from).and_return( - ElasticAPM::TraceContext.parse( - metadata: { - 'traceparent' => fake_trace_context.traceparent.to_header, - 'tracestate' => fake_trace_context.tracestate.to_header - } - ) + fake_trace_context = ElasticAPM::TraceContext.parse( + metadata: { + 'traceparent' => transaction.trace_context.traceparent.to_header, + 'tracestate' => transaction.trace_context.tracestate.to_header + } + ) + + allow_any_instance_of(ElasticAPM::Spies::SidekiqSpy::Middleware).to( + receive(:get_trace_context_from).and_return(fake_trace_context) ) Sidekiq::Testing.inline! do