Skip to content

Commit

Permalink
Fixed Ruby version checks for proxy conf
Browse files Browse the repository at this point in the history
  • Loading branch information
natikgadzhi committed Nov 23, 2023
1 parent d97e181 commit a706d3f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sentry-ruby/spec/sentry/transport/http_transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@

stub_request(fake_response) do |_, http_obj|
expect(http_obj.proxy_address).to eq("example.com")
expect(http_obj.proxy_user).to eq("stan")
expect(http_obj.proxy_pass).to eq("foobar")
expect(http_obj.proxy_port).to eq(8080)

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.5")
expect(http_obj.proxy_user).to eq("stan")
expect(http_obj.proxy_pass).to eq("foobar")
end
end

subject.send_data(data)
Expand All @@ -152,7 +155,7 @@
stub_request(fake_response) do |_, http_obj|
expect(http_obj.read_timeout).to eq(10)

if RUBY_VERSION >= "2.6"
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6")
expect(http_obj.write_timeout).to eq(10)
end
end
Expand Down

0 comments on commit a706d3f

Please sign in to comment.