Skip to content

Commit

Permalink
Removed needless block arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jul 17, 2024
1 parent a140221 commit 524701f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/open-uri/test_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_validation_noverify
end

def test_validation_failure
with_https(nil) {|srv, dr, url, server_thread, server_log|
with_https(nil) {|srv, dr, url|
setup_validation(srv, dr)
assert_raise(OpenSSL::SSL::SSLError) { URI.open("#{url}/data") {} }
sleep 0.5 unless RUBY_PLATFORM =~ /mswin|mingw/
Expand Down
7 changes: 4 additions & 3 deletions test/open-uri/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def with_http(log_tester=lambda {|log| assert_equal([], log) })
def with_https_proxy(proxy_log_tester=lambda {|proxy_log, proxy_access_log| assert_equal([], proxy_log) })
proxy_log = []
proxy_access_log = []
with_https {|srv, dr, url, server_thread, server_log, threads|
with_https {|srv, dr, url|
srv.instance_variable_get(:@server).setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)
cacert_filename = "#{dr}/cacert.pem"
open(cacert_filename, "w") {|f| f << CA_CERT }
Expand All @@ -355,7 +355,7 @@ def with_https_proxy(proxy_log_tester=lambda {|proxy_log, proxy_access_log| asse
proxy = SimpleHTTPProxyServer.new(proxy_host, 0, proxy_log, proxy_access_log)
proxy_port = proxy.instance_variable_get(:@server).addr[1]
proxy_thread = proxy.start
threads << Thread.new {
thread = Thread.new {
proxy_thread.join
if proxy_log_tester
proxy_log_tester.call(proxy_log, proxy_access_log)
Expand All @@ -367,6 +367,7 @@ def with_https_proxy(proxy_log_tester=lambda {|proxy_log, proxy_access_log| asse
ensure
proxy.shutdown
end
assert_join_threads([thread])
}
end

Expand All @@ -390,7 +391,7 @@ def with_https(log_tester=lambda {|log| assert_equal([], log) })
}
threads << Thread.new {
begin
yield srv, dr, "https://#{host}:#{port}", server_thread, log, threads
yield srv, dr, "https://#{host}:#{port}"
ensure
srv.shutdown
end
Expand Down

0 comments on commit 524701f

Please sign in to comment.