# File test/test_request.rb, line 390
    def test_each_body_with_closed_conn
      @request.method = 'POST'
      @request.path = '/'
      @request.version = 'HTTP/1.1'
      @request.set_header('Connection', 'close')
      assert(@request.conn_closed?)

      pio = PseudoIO.new
      pio << 'ABCDEFG'
      @request.set_reader(pio)

      byte_list = %w[ A B C D E F G ]
      @request.each_body(1) do |messg|
        assert_equal(byte_list.first, messg)
        byte_list.shift
      end
      assert(byte_list.empty?)
      assert_exception(RuntimeError) { @request.each_body{} }

      pio = PseudoIO.new
      pio << 'ABCDEFG'
      @request.set_reader(pio)

      byte_list1 = %w[ A B C D ]
      @request.each_body(1) do |messg|
        assert_equal(byte_list1.first, messg)
        byte_list1.shift
        break if byte_list1.empty?
      end

      byte_list2 = %w[ E F G ]
      @request.each_body(1) do |messg|
        assert_equal(byte_list2.first, messg)
        byte_list2.shift
      end
      assert(byte_list2.empty?)
      assert_exception(RuntimeError) { @request.each_body{} }
    end