test/instrumentation/rack_test.rb in instana-1.195.4 vs test/instrumentation/rack_test.rb in instana-1.197.0.pre1
- old
+ new
@@ -78,13 +78,10 @@
assert_equal "GET", rack_span[:data][:http][:method]
assert_equal "/mrlobster", rack_span[:data][:http][:url]
assert_equal 200, rack_span[:data][:http][:status]
assert_equal 'example.org', rack_span[:data][:http][:host]
assert rack_span.key?(:f)
- assert rack_span[:f].key?(:e)
- assert rack_span[:f].key?(:h)
- assert_equal ::Instana.agent.agent_uuid, rack_span[:f][:h]
assert !rack_span.key?(:stack)
# Restore to default
::Instana.config[:collect_backtraces] = false
end
@@ -132,13 +129,10 @@
assert rack_span[:data].key?(:http)
assert_equal "POST", rack_span[:data][:http][:method]
assert_equal "/mrlobster", rack_span[:data][:http][:url]
assert_equal 200, rack_span[:data][:http][:status]
assert rack_span.key?(:f)
- assert rack_span[:f].key?(:e)
- assert rack_span[:f].key?(:h)
- assert_equal ::Instana.agent.agent_uuid, rack_span[:f][:h]
end
def test_basic_put
clear_all!
put '/mrlobster'
@@ -164,13 +158,10 @@
assert rack_span[:data].key?(:http)
assert_equal "PUT", rack_span[:data][:http][:method]
assert_equal "/mrlobster", rack_span[:data][:http][:url]
assert_equal 200, rack_span[:data][:http][:status]
assert rack_span.key?(:f)
- assert rack_span[:f].key?(:e)
- assert rack_span[:f].key?(:h)
- assert_equal ::Instana.agent.agent_uuid, rack_span[:f][:h]
end
def test_context_continuation
clear_all!
continuation_id = Instana::Util.generate_id
@@ -200,13 +191,10 @@
assert rack_span[:data].key?(:http)
assert_equal "GET", rack_span[:data][:http][:method]
assert_equal "/mrlobster", rack_span[:data][:http][:url]
assert_equal 200, rack_span[:data][:http][:status]
assert rack_span.key?(:f)
- assert rack_span[:f].key?(:e)
- assert rack_span[:f].key?(:h)
- assert_equal ::Instana.agent.agent_uuid, rack_span[:f][:h]
# Context validation
# The first span should have the passed in trace ID
# and specify the passed in span ID as it's parent.
assert_equal continuation_id, rack_span[:t]
@@ -258,11 +246,11 @@
end
def test_custom_headers_capture
clear_all!
::Instana.config[:collect_backtraces] = true
- ::Instana.agent.extra_headers = %w(X-Capture-This X-Capture-That)
+ ::Instana.agent.define_singleton_method(:extra_headers) { %w(X-Capture-This X-Capture-That) }
get '/mrlobster', {}, { "HTTP_X_CAPTURE_THIS" => "ThereYouGo" }
assert last_response.ok?
assert_equal "ThereYouGo", last_request.env["HTTP_X_CAPTURE_THIS"]
@@ -278,10 +266,10 @@
assert_equal "ThereYouGo", rack_span[:data][:http][:header][:"X-Capture-This"]
assert !rack_span.key?(:stack)
# Restore to default
::Instana.config[:collect_backtraces] = false
- ::Instana.agent.extra_headers = nil
+ ::Instana.agent.singleton_class.send(:remove_method, :extra_headers)
end
def test_capture_http_path_template
clear_all!