[前][次][番号順一覧][スレッド一覧]

ruby-changes:14742

From: shugo <ko1@a...>
Date: Sat, 6 Feb 2010 23:09:23 +0900 (JST)
Subject: [ruby-changes:14742] Ruby:r26601 (trunk): * test/net/imap/test_imap_response_parser.rb (test_resp_text_code): added a test

shugo	2010-02-06 23:09:13 +0900 (Sat, 06 Feb 2010)

  New Revision: 26601

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26601

  Log:
    * test/net/imap/test_imap_response_parser.rb (test_resp_text_code): added a test
      for [ruby-core:27913].

  Modified files:
    trunk/test/net/imap/test_imap_response_parser.rb

Index: test/net/imap/test_imap_response_parser.rb
===================================================================
--- test/net/imap/test_imap_response_parser.rb	(revision 26600)
+++ test/net/imap/test_imap_response_parser.rb	(revision 26601)
@@ -5,13 +5,17 @@
   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 @@
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]