summaryrefslogtreecommitdiff
path: root/test/net/ftp
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-20 21:56:40 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-20 21:56:40 +0000
commitd795f2d1a803c03a7180f6f5049d3a9a0e8849f0 (patch)
treef7d664d38e75358c7e532c5d077ce7223d6dedec /test/net/ftp
parent03570f8091bc5641bdb0020eccfa6bdf8556c8c3 (diff)
Shutdown gracefully.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/ftp')
-rw-r--r--test/net/ftp/test_ftp.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index 91250a9..5a566a5 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -271,6 +271,8 @@ class FTPTest < Test::Unit::TestCase
end
conn.print(l, "\r\n")
end
+ conn.shutdown(Socket::SHUT_WR)
+ conn.read
conn.close
sock.print("226 Directory send OK.\r\n")
}
@@ -398,6 +400,7 @@ class FTPTest < Test::Unit::TestCase
buf << s
end
end
+ assert_equal(1024, buf.bytesize)
assert_equal(binary_data[0, 1024], buf)
assert_match(/\APORT /, commands.shift)
assert_equal("RETR foo\r\n", commands.shift)
@@ -434,6 +437,8 @@ class FTPTest < Test::Unit::TestCase
sleep(0.1)
conn.print(s)
end
+ conn.shutdown(Socket::SHUT_WR)
+ conn.read
conn.close
sock.print("226 Transfer complete.\r\n")
}
@@ -450,6 +455,7 @@ class FTPTest < Test::Unit::TestCase
ftp.retrbinary("RETR foo", 1024) do |s|
buf << s
end
+ assert_equal(binary_data.bytesize, buf.bytesize)
assert_equal(binary_data, buf)
assert_match(/\APORT /, commands.shift)
assert_equal("RETR foo\r\n", commands.shift)