summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-06 14:09:13 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-06 14:09:13 +0000
commitd724d5e771cc5bd64311e40e478cf2f4b8977747 (patch)
tree51cc8815f4fe5af14ac3fcdfc198ba2917b9d9a2
parentb44070175a1e3888e11ae37eb627979bec25c979 (diff)
* 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
-rw-r--r--test/net/imap/test_imap_response_parser.rb18
1 files 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 5c122dd59d5..2eeaea04f00 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(<<EOF.gsub(/\n/, "\r\n").taint)
+* OK [CLOSED] Previous mailbox closed.
+EOF
+ assert_equal nil, response
+ end
end