 
   test "with get until" do
     assert capture_io(fn ->
-      :io.scan_erl_form('>')
-    end) == ">"
+             :io.scan_erl_form('>')
+           end) == ">"
 
     assert capture_io("1.\n", fn ->
-      :io.scan_erl_form('>')
-    end) == ">"
+             :io.scan_erl_form('>')
+           end) == ">"
 
     assert capture_io("1\n.\n", fn ->
-       :io.scan_erl_form('>')
-    end) == ">>"
+             :io.scan_erl_form('>')
+           end) == ">>"
 
     assert capture_io([capture_prompt: false], fn ->
-      :io.scan_erl_form('>')
-    end) == ""
-
-    capture_io(fn ->
-      assert :io.scan_erl_form('>') == {:eof, 1}
-    end)
-
-   capture_io("1", fn ->
-     assert :io.scan_erl_form('>') == {:ok, [{:integer, 1, 1}], 1}
-     assert :io.scan_erl_form('>') == {:eof, 1}
-   end)
+             :io.scan_erl_form('>')
+           end) == ""
+
+    capture_io(fn ->
+      assert :io.scan_erl_form('>') == {:eof, 1}
+    end)
+
+    capture_io("1", fn ->
+      assert :io.scan_erl_form('>') == {:ok, [{:integer, 1, 1}], 1}
+      assert :io.scan_erl_form('>') == {:eof, 1}
+    end)
 
     capture_io("1\n.", fn ->
       assert :io.scan_erl_form('>') == {:ok, [{:integer, 1, 1}, {:dot, 2}], 2}

  test "capture :stderr by two processes" do
    spawn(fn -> capture_io(:stderr, fn -> Process.sleep(100) end) end)
    Process.sleep(10)
    assert_raise RuntimeError, "IO device registered at :standard_error is already captured", fn ->
      capture_io(:stderr, fn -> nil end)
    end
    Process.sleep(100)
  end

  defp send_and_receive_io(req) do
    pid = self()
    send :erlang.group_leader, {:io_request, pid, pid, req}
    receive do
      {:io_reply, ^pid, res} -> res
    end


  test "with get line" do
    assert capture_io(fn ->
             :io.get_line(">")
           end) == ">"

    assert capture_io([capture_prompt: false], fn ->
             :io.get_line(">")
           end) == ""

    capture_io(fn ->
      assert :io.get_line(">") == :eof
