[前][次][番号順一覧][スレッド一覧]

ruby-changes:21567

From: akr <ko1@a...>
Date: Thu, 3 Nov 2011 19:55:35 +0900 (JST)
Subject: [ruby-changes:21567] akr:r33616 (trunk): close a socket in test_socket_new.

akr	2011-11-03 19:55:26 +0900 (Thu, 03 Nov 2011)

  New Revision: 33616

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33616

  Log:
    close a socket in test_socket_new.

  Modified files:
    trunk/test/socket/test_socket.rb

Index: test/socket/test_socket.rb
===================================================================
--- test/socket/test_socket.rb	(revision 33615)
+++ test/socket/test_socket.rb	(revision 33616)
@@ -7,8 +7,12 @@
 
 class TestSocket < Test::Unit::TestCase
   def test_socket_new
-    s = Socket.new(:INET, :STREAM)
-    assert_kind_of(Socket, s)
+    begin
+      s = Socket.new(:INET, :STREAM)
+      assert_kind_of(Socket, s)
+    ensure
+      s.close
+    end
   end
 
   def test_unpack_sockaddr

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]