Skip to content

Commit e02ad49

Browse files
committed
Keep everything to sucker_punch test file.
1 parent cd45c06 commit e02ad49

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

spec/datadog/tracing/contrib/sucker_punch/patcher_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def perform(action = :none, **_)
5050
end
5151
end
5252

53+
def get_spans_count(tracer = self.tracer)
54+
fetch_traces(tracer).sum { |trace| trace.spans.length }
55+
end
56+
5357
context 'successful job' do
5458
subject(:dummy_worker_success) { worker_class.perform_async }
5559

spec/datadog/tracing/contrib/support/tracer_helpers.rb

-9
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ def fetch_spans(tracer = self.tracer)
5353
end
5454
end
5555

56-
def get_spans_count(tracer = self.tracer)
57-
count = 0
58-
traces = fetch_traces(tracer)
59-
traces.each do |trace|
60-
count += trace.instance_variable_get(:@spans).length
61-
end
62-
count
63-
end
64-
6556
# Remove all traces from the current tracer instance and
6657
# busts cache of +#spans+ and +#span+.
6758
def clear_traces!

0 commit comments

Comments
 (0)