Skip to content

Commit 814ed36

Browse files
committed
bash_unit changes the current working directory before loading the test file
1 parent c16b95b commit 814ed36

File tree

2 files changed

+10
-34
lines changed

2 files changed

+10
-34
lines changed

bash_unit

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# https://github.com/pgrange/bash_unit
1818

19-
VERSION=v1.4.0
19+
VERSION=v1.5.0
2020

2121
ESCAPE=$(printf "\033")
2222
NOCOLOR="${ESCAPE}[0m"

docs/man/man1/bash_unit.1

+9-33
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: bash_unit
33
.\" Author: [see the "AUTHORS" section]
44
.\" Generator: Asciidoctor 1.5.5
5-
.\" Date: 2017-07-03
5+
.\" Date: 2017-07-07
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "BASH_UNIT" "1" "2017-07-03" "\ \&" "\ \&"
10+
.TH "BASH_UNIT" "1" "2017-07-07" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -53,13 +53,13 @@ The only supported value is \fBtap\fP.
5353
.RE
5454
.SH "HOW TO RUN TESTS"
5555
.sp
56-
To run tests, simply call \fBbash_unit\fP with all your tests files as parameter. For instance to run \fBbash_unit\fP tests, from \fBbash_unit\fP directory:
56+
To run tests, simply call \fBbash_unit\fP with all your tests files as parameter. For instance to run some \fBbash_unit\fP tests, from \fBbash_unit\fP directory:
5757
.sp
5858
.if n \{\
5959
.RS 4
6060
.\}
6161
.nf
62-
\&./bash_unit tests/test_bash_unit.sh
62+
\&./bash_unit tests/test_core.sh
6363
.fi
6464
.if n \{\
6565
.RE
@@ -69,7 +69,7 @@ To run tests, simply call \fBbash_unit\fP with all your tests files as parameter
6969
.RS 4
7070
.\}
7171
.nf
72-
Running tests in tests/test_bash_unit.sh
72+
Running tests in tests/test_core.sh
7373
Running test_assert_equals_fails_when_not_equal... SUCCESS
7474
Running test_assert_equals_succeed_when_equal... SUCCESS
7575
Running test_assert_fail_fails... SUCCESS
@@ -82,25 +82,14 @@ Running test_assert_shows_stdout_on_failure... SUCCESS
8282
Running test_assert_status_code_fails... SUCCESS
8383
Running test_assert_status_code_succeeds... SUCCESS
8484
Running test_assert_succeeds... SUCCESS
85-
Running test_bash_unit_changes_cwd_to_current_test_file_directory... SUCCESS
86-
Running test_bash_unit_runs_teardown_even_in_case_of_failure... SUCCESS
87-
Running test_bash_unit_succeed_when_no_failure_even_if_no_teardown... SUCCESS
88-
Running test_display_usage_when_test_file_does_not_exist... SUCCESS
89-
Running test_exit_code_not_0_in_case_of_failure... SUCCESS
9085
Running test_fail_fails... SUCCESS
9186
Running test_fail_prints_failure_message... SUCCESS
9287
Running test_fail_prints_where_is_error... SUCCESS
93-
Running test_fails_when_test_file_does_not_exist... SUCCESS
9488
Running test_fake_actually_fakes_the_command... SUCCESS
9589
Running test_fake_can_fake_inline... SUCCESS
9690
Running test_fake_echo_stdin_when_no_params... SUCCESS
9791
Running test_fake_exports_faked_in_subshells... SUCCESS
9892
Running test_fake_transmits_params_to_fake_code... SUCCESS
99-
Running test_one_test_should_stop_after_first_assertion_failure... SUCCESS
100-
Running test_one_test_should_stop_when_assert_fails... SUCCESS
101-
Running test_run_all_file_parameters... SUCCESS
102-
Running test_run_all_tests_even_in_case_of_failure... SUCCESS
103-
Running test_run_only_tests_that_match_pattern... SUCCESS
10493
.fi
10594
.if n \{\
10695
.RE
@@ -114,7 +103,7 @@ functions against this pattern.
114103
.RS 4
115104
.\}
116105
.nf
117-
\&./bash_unit \-p fail_fails \-p assert tests/test_bash_unit.sh
106+
\&./bash_unit \-p fail_fails \-p assert tests/test_core.sh
118107
.fi
119108
.if n \{\
120109
.RE
@@ -124,7 +113,7 @@ functions against this pattern.
124113
.RS 4
125114
.\}
126115
.nf
127-
Running tests in tests/test_bash_unit.sh
116+
Running tests in tests/test_core.sh
128117
Running test_assert_equals_fails_when_not_equal... SUCCESS
129118
Running test_assert_equals_succeed_when_equal... SUCCESS
130119
Running test_assert_fail_fails... SUCCESS
@@ -138,8 +127,6 @@ Running test_assert_status_code_fails... SUCCESS
138127
Running test_assert_status_code_succeeds... SUCCESS
139128
Running test_assert_succeeds... SUCCESS
140129
Running test_fail_fails... SUCCESS
141-
Running test_one_test_should_stop_after_first_assertion_failure... SUCCESS
142-
Running test_one_test_should_stop_when_assert_fails... SUCCESS
143130
.fi
144131
.if n \{\
145132
.RE
@@ -154,7 +141,7 @@ output with the \fI\-f\fP option.
154141
.RS 4
155142
.\}
156143
.nf
157-
\&./bash_unit \-f tap tests/test_bash_unit.sh
144+
\&./bash_unit \-f tap tests/test_core.sh
158145
.fi
159146
.if n \{\
160147
.RE
@@ -164,7 +151,7 @@ output with the \fI\-f\fP option.
164151
.RS 4
165152
.\}
166153
.nf
167-
# Running tests in tests/test_bash_unit.sh
154+
# Running tests in tests/test_core.sh
168155
ok \- test_assert_equals_fails_when_not_equal
169156
ok \- test_assert_equals_succeed_when_equal
170157
ok \- test_assert_fail_fails
@@ -177,25 +164,14 @@ ok \- test_assert_shows_stdout_on_failure
177164
ok \- test_assert_status_code_fails
178165
ok \- test_assert_status_code_succeeds
179166
ok \- test_assert_succeeds
180-
ok \- test_bash_unit_changes_cwd_to_current_test_file_directory
181-
ok \- test_bash_unit_runs_teardown_even_in_case_of_failure
182-
ok \- test_bash_unit_succeed_when_no_failure_even_if_no_teardown
183-
ok \- test_display_usage_when_test_file_does_not_exist
184-
ok \- test_exit_code_not_0_in_case_of_failure
185167
ok \- test_fail_fails
186168
ok \- test_fail_prints_failure_message
187169
ok \- test_fail_prints_where_is_error
188-
ok \- test_fails_when_test_file_does_not_exist
189170
ok \- test_fake_actually_fakes_the_command
190171
ok \- test_fake_can_fake_inline
191172
ok \- test_fake_echo_stdin_when_no_params
192173
ok \- test_fake_exports_faked_in_subshells
193174
ok \- test_fake_transmits_params_to_fake_code
194-
ok \- test_one_test_should_stop_after_first_assertion_failure
195-
ok \- test_one_test_should_stop_when_assert_fails
196-
ok \- test_run_all_file_parameters
197-
ok \- test_run_all_tests_even_in_case_of_failure
198-
ok \- test_run_only_tests_that_match_pattern
199175
.fi
200176
.if n \{\
201177
.RE

0 commit comments

Comments
 (0)