 
     unless moduletag do
       raise "cannot define #{type}. Please make sure you have invoked " <>
-            "\"use ExUnit.Case\" in the current module"
+              "\"use ExUnit.Case\" in the current module"
     end
 
     registered_attributes = Module.get_attribute(mod, :ex_unit_registered)

  end

  defp validate_tags(tags) do
    for tag <- @reserved,
        Map.has_key?(tags, tag) do
      raise "cannot set tag #{inspect tag} because it is reserved by ExUnit"
    end

    unless is_atom(tags[:type]),
      do: raise "value for tag \":type\" must be an atom"

    tags
  end

  defp normalize_tags(tags) do
    Enum.reduce Enum.reverse(tags), %{}, fn
      tag, acc when is_atom(tag) -> Map.put(acc, tag, true)
      tag, acc when is_list(tag) -> tag |> Enum.into(acc)
    end
  end
end

  defmacro __using__(opts) do
    unless Process.whereis(ExUnit.Server) do
      raise "cannot use ExUnit.Case without starting the ExUnit application, " <>
              "please call ExUnit.start() or explicitly start the :ex_unit app"
    end

    quote do
      async = !!unquote(opts)[:async]

      unless Module.get_attribute(__MODULE__, :ex_unit_tests) do
        attributes = [
          :ex_unit_tests,
          :tag,
          :describetag,
          :moduletag,
          :ex_unit_registered,
          :ex_unit_used_describes
        ]

        Enum.each(attributes, &Module.register_attribute(__MODULE__, &1, accumulate: true))

        @before_compile ExUnit.Case
        @after_compile ExUnit.Case
