Skip to content

Commit a1c0e44

Browse files
committed
ADD setup_suite and teardown_suite
Mentioning them in the documentation.
1 parent 91eb0d0 commit a1c0e44

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ You may write a *setup* function that will be exectuted before each test is run.
162162

163163
You may write a *teardown* function that will be exectuted after each test is run.
164164

165-
If you need to set someting up only once for all tests, simply write your code outside any test function, this is a bash script.
165+
You may write a *setup_suite* function that will be executed only once before all the tests of your test file.
166+
167+
You may write a *teardown_suite* function that will be executed only once after all the tests of your test file.
168+
169+
If you write code outside of any bash function, this code will be executed once at test file loading time since
170+
your file is a bash script and *bash_unit* sources it before running your tests. It is suggested to write a
171+
*setup_suite* function and avoid any code outside a bash function.
166172

167173
If you want to keep an eye on a test not yet implemented, prefix the name of the function by *todo* instead of test.
168174
Test to do are not executed and do not impact the global status of your test suite but are displayed in *bash_unit* output.

0 commit comments

Comments
 (0)