Skip to content

Commit 7d1a763

Browse files
committed
Add more documentation to ExUnit.Callbacks
1 parent af76eff commit 7d1a763

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: lib/ex_unit/lib/ex_unit/callbacks.ex

+13
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ defmodule ExUnit.Callbacks do
7979
compile_callbacks(env, :exunit_teardown_all) ]
8080
end
8181

82+
@doc """
83+
Called before the start of each test.
84+
"""
8285
defmacro setup(var // quote(do: _), block) do
8386
quote do
8487
name = :"__exunit_setup_#{length(@exunit_setup)}"
@@ -87,6 +90,10 @@ defmodule ExUnit.Callbacks do
8790
end
8891
end
8992

93+
@doc """
94+
Called after the finish of each test. Note that, if the test crasches with an exit
95+
message `teardown` will not be run.
96+
"""
9097
defmacro teardown(var // quote(do: _), block) do
9198
quote do
9299
name = :"__exunit_teardown_#{length(@exunit_teardown)}"
@@ -95,6 +102,9 @@ defmodule ExUnit.Callbacks do
95102
end
96103
end
97104

105+
@doc """
106+
Called before the start of a case.
107+
"""
98108
defmacro setup_all(var // quote(do: _), block) do
99109
quote do
100110
name = :"__exunit_setup_all_#{length(@exunit_setup_all)}"
@@ -103,6 +113,9 @@ defmodule ExUnit.Callbacks do
103113
end
104114
end
105115

116+
@doc """
117+
Called after the finish of each case.
118+
"""
106119
defmacro teardown_all(var // quote(do: _), block) do
107120
quote do
108121
name = :"__exunit_teardown_all_#{length(@exunit_teardown_all)}"

0 commit comments

Comments
 (0)