   def test_fun1, do: 1
 end
 
-defmodule ExUnit.DocTestTest.SomewhatGoodModule1 do
+defmodule ExUnit.DocTestTest.SomewhatGoodModuleWithExcept do
   @doc """
   iex> test_fun
   1

  def two_exceptions
end

defmodule ExUnit.DocTestTest.SomewhatGoodModule do
  @doc """
  iex> test_fun
  1

  """
  def min(a,b), do: max(a,b)
end

defmodule ExUnit.DocTestTest.Invalid do
  @doc """
  iex> _a = 1
  1

  iex> _a + 1
  2
  """
  def no_leak do
  end
end


defmodule ExUnit.DocTestTest do
  use ExUnit.Case

  # This is intentional. The doctests in DocTest's docs fail
  # for demonstration purposes.
  # doctest ExUnit.DocTest

  doctest ExUnit.DocTestTest.GoodModule, import: true
  doctest ExUnit.DocTestTest.SomewhatGoodModuleWithOnly, only: [test_fun: 0], import: true
  doctest ExUnit.DocTestTest.SomewhatGoodModuleWithExcept, except: [test_fun1: 0], import: true
  doctest ExUnit.DocTestTest.NoImport

  assert_raise ExUnit.DocTest.Error, fn ->
    doctest ExUnit.DocTestTest.ExceptionModule
  end

  test :no_var_leak do
    assert_raise CompileError, %r"function '_a'/0 undefined", fn ->
      defmodule NeverCompiled do
        import ExUnit.DocTest
        doctest ExUnit.DocTestTest.Invalid
      end
    end
  end
end
