From 05aac90a1bcfeb180f5e78ea8b00a4d1b04d5eed Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 14 Jul 2019 17:18:17 +0900 Subject: Warn open-uri's "open" method at Kernel. Use URI.open instead. Thanks for the patch by jeremyevans0 (Jeremy Evans) [Misc #15893]. --- test/open-uri/test_ssl.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/open-uri/test_ssl.rb') diff --git a/test/open-uri/test_ssl.rb b/test/open-uri/test_ssl.rb index 337139604f..4f645d83b9 100644 --- a/test/open-uri/test_ssl.rb +++ b/test/open-uri/test_ssl.rb @@ -67,7 +67,7 @@ class TestOpenURISSL def setup_validation(srv, dr) cacert_filename = "#{dr}/cacert.pem" - open(cacert_filename, "w") {|f| f << CA_CERT } + URI.open(cacert_filename, "w") {|f| f << CA_CERT } srv.mount_proc("/data", lambda { |req, res| res.body = "ddd" } ) cacert_filename end @@ -75,7 +75,7 @@ class TestOpenURISSL def test_validation_success with_https {|srv, dr, url| cacert_filename = setup_validation(srv, dr) - open("#{url}/data", :ssl_ca_cert => cacert_filename) {|f| + URI.open("#{url}/data", :ssl_ca_cert => cacert_filename) {|f| assert_equal("200", f.status[0]) assert_equal("ddd", f.read) } @@ -85,7 +85,7 @@ class TestOpenURISSL def test_validation_noverify with_https {|srv, dr, url| setup_validation(srv, dr) - open("#{url}/data", :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE) {|f| + URI.open("#{url}/data", :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE) {|f| assert_equal("200", f.status[0]) assert_equal("ddd", f.read) } @@ -103,7 +103,7 @@ class TestOpenURISSL end with_https(log_tester) {|srv, dr, url, server_thread, server_log| setup_validation(srv, dr) - assert_raise(OpenSSL::SSL::SSLError) { open("#{url}/data") {} } + assert_raise(OpenSSL::SSL::SSLError) { URI.open("#{url}/data") {} } } end @@ -149,7 +149,7 @@ class TestOpenURISSL } with_https_proxy(proxy_log_tester) {|srv, dr, url_, cacert_filename, cacert_directory, proxy_host, proxy_port| url = url_ - open("#{url}/proxy", :proxy=>"http://#{proxy_host}:#{proxy_port}/", :ssl_ca_cert => cacert_filename) {|f| + URI.open("#{url}/proxy", :proxy=>"http://#{proxy_host}:#{proxy_port}/", :ssl_ca_cert => cacert_filename) {|f| assert_equal("200", f.status[0]) assert_equal("proxy", f.read) } @@ -165,7 +165,7 @@ class TestOpenURISSL } with_https_proxy(proxy_log_tester) {|srv, dr, url_, cacert_filename, cacert_directory, proxy_host, proxy_port| url = url_ - open("#{url}/proxy", :proxy=>"http://#{proxy_host}:#{proxy_port}/", :ssl_ca_cert => cacert_directory) {|f| + URI.open("#{url}/proxy", :proxy=>"http://#{proxy_host}:#{proxy_port}/", :ssl_ca_cert => cacert_directory) {|f| assert_equal("200", f.status[0]) assert_equal("proxy", f.read) } -- cgit v1.2.3