     end
 
     ExUnit.Server.modules_loaded()
-    assert capture_io(fn -> ExUnit.run end) =~
-           "** (RuntimeError) ExUnit callback in " <>
-           "ExUnit.CallbacksTest.SetupReservedTest is " <>
-           "trying to set reserved field :file to \"foo\""
+
+    expected =
+      "** (RuntimeError) ExUnit callback in " <>
+        "ExUnit.CallbacksTest.SetupReservedTest is " <>
+        "trying to set reserved field :file to \"foo\""
+
+    assert capture_io(fn -> ExUnit.run() end) =~ expected
   end
 end
 

    end

    ExUnit.Server.modules_loaded()
    assert capture_io(fn -> ExUnit.run end) =~
           "1 test, 0 failures"
  end

  test "named callbacks run custom code in order" do

      use ExUnit.Case

      setup do
        on_exit(fn ->
          IO.puts("on_exit setup run")
        end)

        :ok
      end

      setup_all do
        on_exit(fn ->
          IO.puts("on_exit setup_all run")
        end)

        :ok
      end

      test "ok" do
        on_exit(fn ->
          IO.puts("simple on_exit run")
        end)

        flunk("oops")
      end
    end

    no_formatters!()
    ExUnit.Server.modules_loaded()
    output = capture_io(fn -> ExUnit.run() end)

    expected = """
    simple on_exit run
    on_exit setup run
    on_exit setup_all run
    """

    assert output =~ expected
  end

  test "raises an error when setting an invalid callback in setup" do
