Skip to content

Commit

Permalink
remove unused span helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jan 30, 2024
1 parent 8b1155e commit f979692
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions spec/support/span_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,6 @@ def description_of(actual) # rubocop:disable Lint/NestedMethodDefinition
define_have_error_tag(:stack, Datadog::Tracing::Metadata::Ext::Errors::TAG_STACK)
define_have_error_tag(:type, Datadog::Tracing::Metadata::Ext::Errors::TAG_TYPE)

# @param tags [Hash] key value pairs to tags/metrics to assert on
RSpec::Matchers.define :have_metadata do |tags|
match do |actual|
tags.all? do |key, value|
values_match? value, actual.get_tag(key)
end
end

match_when_negated do |actual|
if tags.respond_to?(:any?)
tags.any? do |key, value|
!values_match? value, actual.get_tag(key)
end
else
# Allows for `expect(span).to_not have_metadata('my.tag')` syntax
values_match? nil, actual.get_tag(tags)
end
end

def description_of(actual)
"Span with metadata #{actual.send(:meta).merge(actual.send(:metrics))}"
end
end

RSpec::Matchers.define :a_span_with do |expected|
match do |actual|
actual.instance_of?(Datadog::Tracing::Span) &&
Expand All @@ -84,13 +60,4 @@ def description_of(actual)
end
end
end

RSpec::Matchers.define :a_span_operation_with do |expected|
match do |actual|
actual.instance_of?(Datadog::Tracing::SpanOperation) &&
expected.all? do |key, value|
actual.__send__(key) == value
end
end
end
end

0 comments on commit f979692

Please sign in to comment.