ruby-changes:15769
From: yugui <ko1@a...>
Date: Sun, 9 May 2010 12:10:41 +0900 (JST)
Subject: [ruby-changes:15769] Ruby:r27698 (ruby_1_9_2): merges r27691 from trunk into ruby_1_9_2.
yugui 2010-05-09 12:10:20 +0900 (Sun, 09 May 2010) New Revision: 27698 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27698 Log: merges r27691 from trunk into ruby_1_9_2. -- * test/net/imap/test_imap.rb: use IPv4 for test_imaps_post_connection_check. [ruby-dev:41189] Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/test/net/imap/test_imap.rb Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 27697) +++ ruby_1_9_2/ChangeLog (revision 27698) @@ -1,3 +1,8 @@ +Sun May 9 09:15:03 2010 Shugo Maeda <shugo@r...> + + * test/net/imap/test_imap.rb: use IPv4 for + test_imaps_post_connection_check. [ruby-dev:41189] + Sun May 9 02:57:02 2010 Aaron Patterson <aaron@t...> * ext/fiddle/lib/fiddle.rb: only require DL if it hasn't been required Index: ruby_1_9_2/test/net/imap/test_imap.rb =================================================================== --- ruby_1_9_2/test/net/imap/test_imap.rb (revision 27697) +++ ruby_1_9_2/test/net/imap/test_imap.rb (revision 27698) @@ -6,6 +6,8 @@ SERVER_KEY = File.expand_path("server.key", File.dirname(__FILE__)) SERVER_CERT = File.expand_path("server.crt", File.dirname(__FILE__)) + SERVER_ADDR = "127.0.0.1" + def setup @do_not_reverse_lookup = Socket.do_not_reverse_lookup Socket.do_not_reverse_lookup = true @@ -83,7 +85,9 @@ if defined?(OpenSSL) assert_raise(OpenSSL::SSL::SSLError) do imaps_test do |port| - Net::IMAP.new("127.0.0.1", + # SERVER_ADDR is different from the hostname in the certificate, + # so the following code should raise a SSLError. + Net::IMAP.new(SERVER_ADDR, :port => port, :ssl => { :ca_file => CA_FILE }) end @@ -107,7 +111,7 @@ end def test_unexpected_eof - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] Thread.start do begin @@ -138,7 +142,7 @@ end def test_idle - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] requests = [] Thread.start do @@ -190,7 +194,7 @@ end def test_exception_during_idle - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] requests = [] Thread.start do @@ -255,7 +259,7 @@ end def test_idle_done_not_during_idle - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] requests = [] Thread.start do @@ -284,7 +288,7 @@ end def test_unexpected_bye - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] Thread.start do begin @@ -314,7 +318,7 @@ private def imaps_test - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] ctx = OpenSSL::SSL::SSLContext.new ctx.ca_file = CA_FILE @@ -352,7 +356,7 @@ end def starttls_test - server = TCPServer.new(0) + server = create_tcp_server port = server.addr[1] Thread.start do begin @@ -391,4 +395,8 @@ server.close end end + + def create_tcp_server + return TCPServer.new(SERVER_ADDR, 0) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/