   pluralization.
   """
   def register_test(%{module: mod, file: file, line: line}, test_type, name, tags) do
-    moduletag = Module.get_attribute(mod, :moduletag)
-
-    unless moduletag do
+    unless Module.has_attribute?(mod, :ex_unit_tests) do
       raise "cannot define #{test_type}. Please make sure you have invoked " <>
               "\"use ExUnit.Case\" in the current module"
     end

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

      unless Module.get_attribute(__MODULE__, :ex_unit_tests) do
        tag_check =
          [:moduletag, :describetag, :tag]
          |> Enum.any?(&Module.get_attribute(__MODULE__, &1))

        if tag_check do
          raise "you must set @tag, @describetag, and @moduletag after the call to \"use ExUnit.Case\""

        {attribute, Module.get_attribute(mod, attribute)}
      end

    moduletag = Module.get_attribute(mod, :moduletag)
    tag = Module.delete_attribute(mod, :tag)
    async = Module.get_attribute(mod, :ex_unit_async)

