File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,12 @@ def session_new_cb
440440 def session_get_cb
441441 @context . session_get_cb
442442 end
443+
444+ class << self
445+ ##
446+ # open is an alias to ::new
447+ alias open new
448+ end
443449 end
444450
445451 ##
Original file line number Diff line number Diff line change @@ -1592,6 +1592,17 @@ def test_fileno
15921592 sock2 . close
15931593 end
15941594
1595+ def test_ssl_socket_new_alias
1596+ mn = OpenSSL ::SSL ::SSLSocket . method ( :new )
1597+ mo = OpenSSL ::SSL ::SSLSocket . method ( :open )
1598+
1599+ if mn . inspect == "#<Method: Class#new>"
1600+ assert_equal mn . hash , mo . hash
1601+ else
1602+ assert_equal mn , mo
1603+ end
1604+ end
1605+
15951606 private
15961607
15971608 def start_server_version ( version , ctx_proc = nil ,
You can’t perform that action at this time.
0 commit comments