зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
b44070175a
Коммит
d724d5e771
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче