require "net/imap" require "test/unit" class IMAPResponseParserTest < Test::Unit::TestCase def setup @do_not_reverse_lookup = Socket.do_not_reverse_lookup Socket.do_not_reverse_lookup = true 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 if Net::IMAP.respond_to?(:max_flag_count) Net::IMAP.max_flag_count = @max_flag_count end end def test_flag_list_safe parser = Net::IMAP::ResponseParser.new response = lambda { $SAFE = 1 parser.parse(<