summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-10 14:40:00 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-10 14:40:00 +0000
commit9bf5457481e252ea9afaada4c6d42789dc20c58f (patch)
tree4237ef7dd40d46dc3446994528a89382fa539834 /test/net
parent0d70c707aeca423854b62d5be6ee2013f2afc2ee (diff)
* test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
exceptions on server thread. Delete read_timeout method call to fix NoMethodError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/ftp/test_ftp.rb22
1 files changed, 9 insertions, 13 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index e3c01d3..f451c39 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -773,20 +773,16 @@ class FTPTest < Test::Unit::TestCase
def create_ftp_server(sleep_time = nil)
server = TCPServer.new(SERVER_ADDR, 0)
@thread = Thread.start do
+ if sleep_time
+ sleep(sleep_time)
+ end
+ sock = server.accept
begin
- if sleep_time
- sleep(sleep_time)
- end
- sock = server.accept
- begin
- yield(sock)
- sock.shutdown(Socket::SHUT_WR)
- sock.read_timeout = 1
- sock.read unless sock.eof?
- ensure
- sock.close
- end
- rescue
+ yield(sock)
+ sock.shutdown(Socket::SHUT_WR)
+ sock.read unless sock.eof?
+ ensure
+ sock.close
end
end
def server.port