Skip to content

Commit

Permalink
Net::HTTP#ipaddr was added in 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rzane committed Aug 5, 2022
1 parent 5abd2f5 commit 786cd11
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/acceptance/net_http/net_http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,11 @@ class TestMarshalingInWebMockNetHTTP
end
end

it "uses the StubSocket to provide IP address" do
Net::HTTP.start("http://example.com") do |http|
expect(http.ipaddr).to eq("127.0.0.1")
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
it "uses the StubSocket to provide IP address" do
Net::HTTP.start("http://example.com") do |http|
expect(http.ipaddr).to eq("127.0.0.1")
end
end
end

Expand Down

0 comments on commit 786cd11

Please sign in to comment.