       case unquote(expr_ast) do
         ^v -> :ok
         actual ->
-          raise ExUnit.ExpectationError,
-            [ prelude: "Expected doctest",
-              expr: unquote(expr),
-              expected: inspect(v),
-              assertion: "inspect as",
-              actual: inspect(actual) ],
+          raise ExUnit.AssertionError,
+            [ message: "Doctest failed",
+              expr: "#{unquote(expr)} should equal #{inspect(v)}",
+              left: inspect(actual) ],
             unquote(stack)
       end
     end

      case unquote(expr_ast) do
        ^v -> :ok
        actual ->
          raise ExUnit.ExpectationError,
            [ prelude: "Expected doctest",
              expr: unquote(expr),
              expected: inspect(v),
              assertion: "evaluate to",
              actual: inspect(actual) ],
            unquote(stack)
      end
    end

      Code.string_to_quoted!(expr, line: line, file: file)
    rescue e ->
      quote do
        raise ExUnit.AssertionError,
          [ message: "Doctest failed",
            expr: "#{unquote(String.strip(expr))} did now compile",
            left: unquote("** #{inspect e.__record__(:name)} #{e.message}") ],
          unquote(stack)
      end
    end
