         # ...
       end
 
+  ### Handlers
+
+  You can define "global" on-exit handlers in `setup_all/1` callbacks:
+
+      setup_all do
+        Database.create_table_for(__MODULE__)
+
+        on_exit(fn ->
+          Database.drop_table_for(__MODULE__)
+        end)
+
+        :ok
+      end
+
+  The handler in the example above will be executed only once, after
+  running all tests in the module.
   """
   defmacro setup_all(block) do
     if Keyword.keyword?(block) do

  `setup_all/1` callbacks are executed in a separate process than tests.
  All `setup_all/1` callbacks are executed in order in the same process.

  ## Examples

      # One-arity function name

        on_exit(fn -> File.rm!("fixture.json") end)
      end

  You can use the same `name_or_ref` across multiple `on_exit/2` calls
  to "override" the registered handler:

      setup do
        on_exit(:drop_table, fn ->
          Database.drop_table()
        end)
      end

      test "a test that shouldn't drop the table" do
        on_exit(:drop_table, fn -> :ok end)
      end

  Relying too much on overriding callbacks like this can lead to test
  cases that are hard to understand and with too many layers of
  indirection. However, it can be useful in some cases or for library
  authors, for example.
  """
  @spec on_exit(term, (() -> term)) :: :ok
  def on_exit(name_or_ref \\ make_ref(), callback) when is_function(callback, 0) do
