diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-27 06:32:00 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-27 06:32:00 +0000 |
commit | 21e4ade56b4261c549fd03f96f4430946d028bea (patch) | |
tree | dce69a18a1e0e6526dde029c8fe835f4ce5d7e88 /test/net | |
parent | 917beef327117cfeee4e1f455d650f08c2268d7e (diff) |
lib/net/imap.rb: Accept continuation requests without response text
The IMAP server of DOCOMO returns such continuation requests.
[ruby-list:50558]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/imap/test_imap.rb | 2 | ||||
-rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb index e4466fe8dd..0f64e882cc 100644 --- a/test/net/imap/test_imap.rb +++ b/test/net/imap/test_imap.rb @@ -432,7 +432,7 @@ class IMAPTest < Test::Unit::TestCase c.signal end end - assert_raise(Net::IMAP::Error) do + assert_raise(EOFError) do imap.idle do |res| m.synchronize do in_idle = true diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index b8c6db86cd..7aac2786fe 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -60,7 +60,7 @@ EOF def test_flag_xlist_inbox parser = Net::IMAP::ResponseParser.new - response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) * XLIST (\\Inbox) "." "INBOX" EOF assert_equal [:Inbox], response.data.attr @@ -311,4 +311,12 @@ EOF response = parser.parse("* 1 FETCH (FLAGS (\Seen) MODSEQ (12345) UID 5)\r\n") assert_equal(12345, response.data.attr["MODSEQ"]) end + + def test_continuation_request_without_response_text + parser = Net::IMAP::ResponseParser.new + response = parser.parse("+\r\n") + assert_instance_of(Net::IMAP::ContinuationRequest, response) + assert_equal(nil, response.data.code) + assert_equal("", response.data.text) + end end |