summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-22 06:13:11 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-22 06:13:11 +0000
commit27fb27ff428f94060533a12efa5a71fba55f1649 (patch)
tree18b4268ab27e8d4573d88ce65facf9a932f1b70b /test
parentc45a52af36dbe399ec87b97db13812e20fa500d1 (diff)
net/imap: separate @continuation_request_exception from @exception
Otherwise literal data will be sent even if NO response is returned because @exception is set to nil in receive_responses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/net/imap/test_imap.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index 8659622554..5e2dd71c53 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -582,7 +582,7 @@ EOF
received_mail = sock.read(size)
sock.gets
sock.print("RUBY0001 OK APPEND completed\r\n")
- sock.gets
+ requests.push(sock.gets)
sock.print("* BYE terminating connection\r\n")
sock.print("RUBY0002 OK LOGOUT completed\r\n")
ensure
@@ -598,6 +598,8 @@ EOF
assert_equal("RUBY0001 APPEND INBOX {#{mail.size}}\r\n", requests[0])
assert_equal(mail, received_mail)
imap.logout
+ assert_equal(2, requests.length)
+ assert_equal("RUBY0002 LOGOUT\r\n", requests[1])
ensure
imap.disconnect if imap
end
@@ -619,10 +621,9 @@ EOF
sock = server.accept
begin
sock.print("* OK test server\r\n")
- line = sock.gets
- requests.push(line)
+ requests.push(sock.gets)
sock.print("RUBY0001 NO Mailbox doesn't exist\r\n")
- sock.gets
+ requests.push(sock.gets)
sock.print("* BYE terminating connection\r\n")
sock.print("RUBY0002 OK LOGOUT completed\r\n")
ensure
@@ -639,6 +640,8 @@ EOF
assert_equal(1, requests.length)
assert_equal("RUBY0001 APPEND INBOX {#{mail.size}}\r\n", requests[0])
imap.logout
+ assert_equal(2, requests.length)
+ assert_equal("RUBY0002 LOGOUT\r\n", requests[1])
ensure
imap.disconnect if imap
end