diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-07 03:13:37 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-07 03:13:37 +0000 |
commit | 5ff287ad67935ac4646beafaf8d9e31884917345 (patch) | |
tree | 4158dff68230d70a08bf9d760b367b63e749f410 /test/net | |
parent | 9f3a1d7507eb082d3b7c0c42ae70d753dec82c50 (diff) |
merge revision(s) 46331: [Backport #9885]
* lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body
type as "MIXED" followed immediately by params
[ruby-core:62864] [Bug #9885]
Patch by @rayners (David Raynes). [Fixes GH-622]
https://github.com/ruby/ruby/pull/622
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index 9a83cc17d8..608941c0f1 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -248,4 +248,14 @@ EOF assert_equal("7BIT", delivery_status.encoding) assert_equal(410, delivery_status.size) end + + def test_mixed_boundry + parser = Net::IMAP::ResponseParser.new + response = parser.parse("* 2688 FETCH (UID 179161 BODYSTRUCTURE ((\"TEXT\" \"PLAIN\" (\"CHARSET\" \"iso-8859-1\") NIL NIL \"QUOTED-PRINTABLE\" 200 4 NIL NIL NIL)(\"MESSAGE\" \"DELIVERY-STATUS\" NIL NIL NIL \"7BIT\" 318 NIL NIL NIL)(\"MESSAGE\" \"RFC822\" NIL NIL NIL \"7BIT\" 2177 (\"Tue, 11 May 2010 18:28:16 -0400\" \"Re: Welcome letter\" ((\"David\" NIL \"info\" \"xxxxxxxx.si\")) ((\"David\" NIL \"info\" \"xxxxxxxx.si\")) ((\"David\" NIL \"info\" \"xxxxxxxx.si\")) ((\"Doretha\" NIL \"doretha.info\" \"xxxxxxxx.si\")) NIL NIL \"<AC1D15E06EA82F47BDE18E851CC32F330717704E@localdomain>\" \"<AANLkTikKMev1I73L2E7XLjRs67IHrEkb23f7ZPmD4S_9@localdomain>\") (\"MIXED\" (\"BOUNDARY\" \"000e0cd29212e3e06a0486590ae2\") NIL NIL) 37 NIL NIL NIL) \"REPORT\" (\"BOUNDARY\" \"16DuG.4XbaNOvCi.9ggvq.8Ipnyp3\" \"REPORT-TYPE\" \"delivery-status\") NIL NIL))\r\n") + empty_part = response.data.attr['BODYSTRUCTURE'].parts[2] + assert_equal(empty_part.lines, 37) + assert_equal(empty_part.body.media_type, 'MULTIPART') + assert_equal(empty_part.body.subtype, 'MIXED') + assert_equal(empty_part.body.param['BOUNDARY'], '000e0cd29212e3e06a0486590ae2') + end end |