@@ -47,33 +47,37 @@ commit [0360811][]. It was created via `git clone --bare` and `git push
47
47
48
48
## Table of contents
49
49
50
+ <!-- toc -->
51
+
50
52
- [ Installation] ( #installation )
51
- - [ Supported Bash versions] ( #supported-bash-versions )
52
- - [ Homebrew] ( #homebrew )
53
- - [ npm] ( #npm )
54
- - [ Installing Bats from source] ( #installing-bats-from-source )
55
- - [ Running Bats in Docker] ( #running-bats-in-docker )
56
- - [ Building a Docker image] ( #building-a-docker-image )
53
+ * [ Supported Bash versions] ( #supported-bash-versions )
54
+ * [ Homebrew] ( #homebrew )
55
+ * [ npm] ( #npm )
56
+ * [ Installing Bats from source] ( #installing-bats-from-source )
57
+ * [ Running Bats in Docker] ( #running-bats-in-docker )
58
+ + [ Building a Docker image] ( #building-a-docker-image )
57
59
- [ Usage] ( #usage )
58
60
- [ Writing tests] ( #writing-tests )
59
- - [ ` run ` : Test other commands] ( #run-test-other-commands )
60
- - [ ` load ` : Share common code] ( #load-share-common-code )
61
- - [ ` skip ` : Easily skip tests] ( #skip-easily-skip-tests )
62
- - [ ` setup ` and ` teardown ` : Pre- and post-test hooks] ( #setup-and-teardown-pre--and-post-test-hooks )
63
- - [ Code outside of test cases] ( #code-outside-of-test-cases )
64
- - [ File descriptor 3 (read this if Bats hangs)] ( #file-descriptor-3-read-this-if-bats-hangs )
65
- - [ Printing to the terminal] ( #printing-to-the-terminal )
66
- - [ Special variables] ( #special-variables )
61
+ * [ ` run ` : Test other commands] ( #run-test-other-commands )
62
+ * [ ` load ` : Share common code] ( #load-share-common-code )
63
+ * [ ` skip ` : Easily skip tests] ( #skip-easily-skip-tests )
64
+ * [ ` setup ` and ` teardown ` : Pre- and post-test hooks] ( #setup-and-teardown-pre--and-post-test-hooks )
65
+ * [ Code outside of test cases] ( #code-outside-of-test-cases )
66
+ * [ File descriptor 3 (read this if Bats hangs)] ( #file-descriptor-3-read-this-if-bats-hangs )
67
+ * [ Printing to the terminal] ( #printing-to-the-terminal )
68
+ * [ Special variables] ( #special-variables )
67
69
- [ Testing] ( #testing )
68
70
- [ Support] ( #support )
69
71
- [ Contributing] ( #contributing )
70
72
- [ Contact] ( #contact )
71
73
- [ Version history] ( #version-history )
72
74
- [ Background] ( #background )
73
- - [ Why was this fork created?] ( #why-was-this-fork-created )
74
- - [ What's the plan and why?] ( #whats-the-plan-and-why )
75
+ * [ Why was this fork created?] ( #why-was-this-fork-created )
76
+ * [ What's the plan and why?] ( #whats-the-plan-and-why )
75
77
- [ Copyright] ( #copyright )
76
78
79
+ <!-- tocstop -->
80
+
77
81
## Installation
78
82
79
83
### Supported Bash versions
@@ -132,7 +136,7 @@ install Bats into `/usr/local`,
132
136
$ cd bats-core
133
137
$ ./install.sh /usr/local
134
138
135
- Note that you may need to run ` install.sh ` with ` sudo ` if you do not have
139
+ __ Note: __ You may need to run ` install.sh ` with ` sudo ` if you do not have
136
140
permission to write to the installation prefix.
137
141
138
142
### Running Bats in Docker
@@ -249,10 +253,6 @@ command, saves the exit status and output into special global variables, and
249
253
then returns with a ` 0 ` status code so you can continue to make assertions in
250
254
your test case.
251
255
252
- > Note that the ` run ` helper executes its argument(s) in a subshell, so if
253
- > writing tests against environmental side-effects like a variable's value
254
- > being changed, these changes will not persist after ` run ` completes.
255
-
256
256
For example, let's say you're testing that the ` foo ` command, when passed a
257
257
nonexistent filename, exits with a ` 1 ` status code and prints an error message.
258
258
@@ -280,6 +280,10 @@ without any arguments prints usage information on the first line:
280
280
}
281
281
```
282
282
283
+ __ Note:__ The ` run ` helper executes its argument(s) in a subshell, so if
284
+ writing tests against environmental side-effects like a variable's value
285
+ being changed, these changes will not persist after ` run ` completes.
286
+
283
287
### ` load ` : Share common code
284
288
285
289
You may want to share common code across multiple test files. Bats includes a
@@ -337,7 +341,7 @@ Or you can skip conditionally:
337
341
}
338
342
```
339
343
340
- ` setup ` and ` teardown ` hooks still run for skipped tests.
344
+ __ Note: __ ` setup ` and ` teardown ` hooks still run for skipped tests.
341
345
342
346
### ` setup ` and ` teardown ` : Pre- and post-test hooks
343
347
0 commit comments