@@ -66,14 +66,14 @@ endif::[]
6666
6767== How to run tests
6868
69- To run tests, simply call *bash_unit* with all your tests files as parameter. For instance to run *bash_unit* tests, from *bash_unit* directory:
69+ To run tests, simply call *bash_unit* with all your tests files as parameter. For instance to run some *bash_unit* tests, from *bash_unit* directory:
7070
7171```test
72- ./bash_unit tests/test_bash_unit .sh
72+ ./bash_unit tests/test_core .sh
7373```
7474
7575```output
76- Running tests in tests/test_bash_unit .sh
76+ Running tests in tests/test_core .sh
7777Running test_assert_equals_fails_when_not_equal... SUCCESS
7878Running test_assert_equals_succeed_when_equal... SUCCESS
7979Running test_assert_fail_fails... SUCCESS
@@ -87,36 +87,26 @@ Running test_assert_status_code_fails... SUCCESS
8787Running test_assert_status_code_succeeds... SUCCESS
8888Running test_assert_succeeds... SUCCESS
8989Running test_bash_unit_changes_cwd_to_current_test_file_directory... SUCCESS
90- Running test_bash_unit_runs_teardown_even_in_case_of_failure... SUCCESS
91- Running test_bash_unit_succeed_when_no_failure_even_if_no_teardown... SUCCESS
92- Running test_display_usage_when_test_file_does_not_exist... SUCCESS
93- Running test_exit_code_not_0_in_case_of_failure... SUCCESS
9490Running test_fail_fails... SUCCESS
9591Running test_fail_prints_failure_message... SUCCESS
9692Running test_fail_prints_where_is_error... SUCCESS
97- Running test_fails_when_test_file_does_not_exist... SUCCESS
9893Running test_fake_actually_fakes_the_command... SUCCESS
9994Running test_fake_can_fake_inline... SUCCESS
10095Running test_fake_echo_stdin_when_no_params... SUCCESS
10196Running test_fake_exports_faked_in_subshells... SUCCESS
10297Running test_fake_transmits_params_to_fake_code... SUCCESS
103- Running test_one_test_should_stop_after_first_assertion_failure... SUCCESS
104- Running test_one_test_should_stop_when_assert_fails... SUCCESS
105- Running test_run_all_file_parameters... SUCCESS
106- Running test_run_all_tests_even_in_case_of_failure... SUCCESS
107- Running test_run_only_tests_that_match_pattern... SUCCESS
10898```
10999
110100You might also want to run only specific tests, you may do so with the
111101_-p_ option. This option accepts a pattern as parameter and filters test
112102functions against this pattern.
113103
114104```test
115- ./bash_unit -p fail_fails -p assert tests/test_bash_unit .sh
105+ ./bash_unit -p fail_fails -p assert tests/test_core .sh
116106```
117107
118108```output
119- Running tests in tests/test_bash_unit .sh
109+ Running tests in tests/test_core .sh
120110Running test_assert_equals_fails_when_not_equal... SUCCESS
121111Running test_assert_equals_succeed_when_equal... SUCCESS
122112Running test_assert_fail_fails... SUCCESS
@@ -130,19 +120,17 @@ Running test_assert_status_code_fails... SUCCESS
130120Running test_assert_status_code_succeeds... SUCCESS
131121Running test_assert_succeeds... SUCCESS
132122Running test_fail_fails... SUCCESS
133- Running test_one_test_should_stop_after_first_assertion_failure... SUCCESS
134- Running test_one_test_should_stop_when_assert_fails... SUCCESS
135123```
136124
137125*bash_unit* supports the http://testanything.org/[Test Anything Protocol] so you can ask for a tap formatted
138126output with the _-f_ option.
139127
140128```test
141- ./bash_unit -f tap tests/test_bash_unit .sh
129+ ./bash_unit -f tap tests/test_core .sh
142130```
143131
144132```output
145- # Running tests in tests/test_bash_unit .sh
133+ # Running tests in tests/test_core .sh
146134ok - test_assert_equals_fails_when_not_equal
147135ok - test_assert_equals_succeed_when_equal
148136ok - test_assert_fail_fails
@@ -156,24 +144,14 @@ ok - test_assert_status_code_fails
156144ok - test_assert_status_code_succeeds
157145ok - test_assert_succeeds
158146ok - test_bash_unit_changes_cwd_to_current_test_file_directory
159- ok - test_bash_unit_runs_teardown_even_in_case_of_failure
160- ok - test_bash_unit_succeed_when_no_failure_even_if_no_teardown
161- ok - test_display_usage_when_test_file_does_not_exist
162- ok - test_exit_code_not_0_in_case_of_failure
163147ok - test_fail_fails
164148ok - test_fail_prints_failure_message
165149ok - test_fail_prints_where_is_error
166- ok - test_fails_when_test_file_does_not_exist
167150ok - test_fake_actually_fakes_the_command
168151ok - test_fake_can_fake_inline
169152ok - test_fake_echo_stdin_when_no_params
170153ok - test_fake_exports_faked_in_subshells
171154ok - test_fake_transmits_params_to_fake_code
172- ok - test_one_test_should_stop_after_first_assertion_failure
173- ok - test_one_test_should_stop_when_assert_fails
174- ok - test_run_all_file_parameters
175- ok - test_run_all_tests_even_in_case_of_failure
176- ok - test_run_only_tests_that_match_pattern
177155```
178156
179157== How to write tests
0 commit comments