From d724d5e771cc5bd64311e40e478cf2f4b8977747 Mon Sep 17 00:00:00 2001 From: shugo Date: Sat, 6 Feb 2010 14:09:13 +0000 Subject: [PATCH] * test/net/imap/test_imap_response_parser.rb (test_resp_text_code): added a test for [ruby-core:27913]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/net/imap/test_imap_response_parser.rb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index 5c122dd59d..2eeaea04f0 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -5,13 +5,17 @@ class IMAPResponseParserTest < Test::Unit::TestCase def setup @do_not_reverse_lookup = Socket.do_not_reverse_lookup Socket.do_not_reverse_lookup = true - @max_flag_count = Net::IMAP.max_flag_count - Net::IMAP.max_flag_count = 3 + if Net::IMAP.respond_to?(:max_flag_count) + @max_flag_count = Net::IMAP.max_flag_count + Net::IMAP.max_flag_count = 3 + end end def teardown Socket.do_not_reverse_lookup = @do_not_reverse_lookup - Net::IMAP.max_flag_count = @max_flag_count + if Net::IMAP.respond_to?(:max_flag_count) + Net::IMAP.max_flag_count = @max_flag_count + end end def test_flag_list_safe @@ -51,4 +55,12 @@ EOF end end end + + def test_resp_text_code + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<