Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 65bafad

Browse files
committedFeb 17, 2025··
wip
1 parent ea1f28e commit 65bafad

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed
 

‎sentry-ruby/spec/sentry/net/http_spec.rb

+16-22
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,32 @@
1111
::Logger.new(string_io)
1212
end
1313

14-
context "with IPv6 addresses" do
14+
context "with tracing enabled" do
1515
before do
1616
perform_basic_setup do |config|
1717
config.traces_sample_rate = 1.0
18+
config.transport.transport_class = Sentry::HTTPTransport
19+
config.logger = logger
20+
# the dsn needs to have a real host so we can make a real connection before sending a failed request
21+
config.dsn = 'http://foobarbaz@o447951.ingest.sentry.io/5434472'
1822
end
1923
end
2024

21-
it "correctly parses the short-hand IPv6 addresses" do
22-
stub_normal_response
23-
24-
transaction = Sentry.start_transaction
25-
Sentry.get_current_scope.set_span(transaction)
25+
context "with IPv6 addresses" do
26+
it "correctly parses the short-hand IPv6 addresses" do
27+
stub_normal_response
2628

27-
_ = Net::HTTP.get("::1", "/path", 8080)
29+
transaction = Sentry.start_transaction
30+
Sentry.get_current_scope.set_span(transaction)
2831

29-
expect(transaction.span_recorder.spans.count).to eq(2)
32+
_ = Net::HTTP.get("::1", "/path", 8080)
3033

31-
request_span = transaction.span_recorder.spans.last
32-
expect(request_span.data).to eq(
33-
{ "url" => "http://[::1]/path", "http.request.method" => "GET", "http.response.status_code" => 200 }
34-
)
35-
end
36-
end
34+
expect(transaction.span_recorder.spans.count).to eq(2)
3735

38-
context "with tracing enabled" do
39-
before do
40-
perform_basic_setup do |config|
41-
config.traces_sample_rate = 1.0
42-
config.transport.transport_class = Sentry::HTTPTransport
43-
config.logger = logger
44-
# the dsn needs to have a real host so we can make a real connection before sending a failed request
45-
config.dsn = 'http://foobarbaz@o447951.ingest.sentry.io/5434472'
36+
request_span = transaction.span_recorder.spans.last
37+
expect(request_span.data).to eq(
38+
{ "url" => "http://[::1]/path", "http.request.method" => "GET", "http.response.status_code" => 200 }
39+
)
4640
end
4741
end
4842

‎sentry-ruby/spec/sentry/rspec/matchers_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
1313
config.enabled_environments = ["production"]
1414
config.environment = :test
15+
config.transport.transport_class = Sentry::DummyTransport
1516
end
1617

1718
setup_sentry_test

0 commit comments

Comments
 (0)
Please sign in to comment.