   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"
+    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")
+    end
 
     tags
   end
 
   defp normalize_tags(tags) do
-    Enum.reduce Enum.reverse(tags), %{}, fn
+    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
 end

    {name, describe, describe_line, describetag} =
      case Module.get_attribute(mod, :ex_unit_describe) do
        {line, describe} ->
          {:"#{type} #{describe} #{name}", describe, line, Module.get_attribute(mod, :describetag)}
        _ ->
          {:"#{type} #{name}", nil, nil, []}
      end

    if Module.defines?(mod, {name, 1}) do
      raise ExUnit.DuplicateTestError, ~s("#{name}" is already defined in #{inspect mod})
    end

    tags =
      (tags ++ tag ++ describetag ++ moduletag)
      |> normalize_tags
      |> validate_tags
      |> Map.merge(%{line: line, file: file, registered: registered, async: async,
                     describe: describe, describe_line: describe_line, type: type})

    test = %ExUnit.Test{name: name, case: mod, tags: tags, module: mod}
    Module.put_attribute(mod, :ex_unit_tests, test)

    Enum.each registered_attributes, fn(attribute) ->
      Module.delete_attribute(mod, attribute)
    end

    name
  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
