diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index dcb02db31c..9f766c5722 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -237,7 +237,7 @@ module TestNetHTTP_version_1_1_methods begin h = Net::HTTP.start(config('host'), config('port')) ensure - h.finish + h.finish if h end assert_equal config('host'), h.address assert_equal config('port'), h.port @@ -246,7 +246,7 @@ module TestNetHTTP_version_1_1_methods begin h = Net::HTTP.start(config('host'), config('port'), :ENV) ensure - h.finish + h.finish if h end assert_equal config('host'), h.address assert_equal config('port'), h.port @@ -255,7 +255,7 @@ module TestNetHTTP_version_1_1_methods begin h = Net::HTTP.start(config('host'), config('port'), nil) ensure - h.finish + h.finish if h end assert_equal config('host'), h.address assert_equal config('port'), h.port