   end
 
   test "fails with improper termination" do
-    assert_raise ExUnit.DocTest.Error,
-      ~r[test/ex_unit/doc_test_test\.exs:\d+: expected non-blank line to follow iex> prompt], fn ->
+    message =
+      ~r[test/ex_unit/doc_test_test\.exs:\d+: expected non-blank line to follow iex> prompt]
+
+    assert_raise ExUnit.DocTest.Error, message, fn ->
       defmodule NeverCompiled do
         import ExUnit.DocTest
         doctest ExUnit.DocTestTest.Incomplete

  ** (ArithmeticError) bad argument in arithmetic expression
  """
  def two_exceptions, do: :ok
end |> write_beam

defmodule ExUnit.DocTestTest.SomewhatGoodModuleWithOnly do
  @doc """

Code.require_file("../test_helper.exs", __DIR__)

import ExUnit.TestHelpers

