File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ defmodule ExUnit.Callbacks do
79
79
compile_callbacks ( env , :exunit_teardown_all ) ]
80
80
end
81
81
82
+ @doc """
83
+ Called before the start of each test.
84
+ "" "
82
85
defmacro setup(var // quote(do: _), block) do
83
86
quote do
84
87
name = :" __exunit_setup_ #{length(@exunit_setup)}"
@@ -87,6 +90,10 @@ defmodule ExUnit.Callbacks do
87
90
end
88
91
end
89
92
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
+ """
90
97
defmacro teardown ( var // quote ( do: _ ) , block ) do
91
98
quote do
92
99
name = :"__exunit_teardown_#{ length ( @ exunit_teardown ) } "
@@ -95,6 +102,9 @@ defmodule ExUnit.Callbacks do
95
102
end
96
103
end
97
104
105
+ @doc """
106
+ Called before the start of a case.
107
+ "" "
98
108
defmacro setup_all(var // quote(do: _), block) do
99
109
quote do
100
110
name = :" __exunit_setup_all_ #{length(@exunit_setup_all)}"
@@ -103,6 +113,9 @@ defmodule ExUnit.Callbacks do
103
113
end
104
114
end
105
115
116
+ @ doc """
117
+ Called after the finish of each case.
118
+ """
106
119
defmacro teardown_all ( var // quote ( do: _ ) , block ) do
107
120
quote do
108
121
name = :"__exunit_teardown_all_#{ length ( @ exunit_teardown_all ) } "
You can’t perform that action at this time.
0 commit comments