busser-bats 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +8 -0
  3. data/.github/workflows/lint.yaml +9 -0
  4. data/.github/workflows/publish.yaml +35 -0
  5. data/.gitignore +1 -0
  6. data/.markdownlint-cli2.jsonc +7 -0
  7. data/.markdownlint.yaml +9 -0
  8. data/.rubocop.yml +11 -0
  9. data/.tool-versions +1 -0
  10. data/CHANGELOG.md +28 -0
  11. data/Gemfile +25 -1
  12. data/Guardfile +26 -0
  13. data/README.md +12 -8
  14. data/Rakefile +5 -14
  15. data/busser-bats.gemspec +17 -24
  16. data/config/cucumber.yml +1 -0
  17. data/config/features/plugin_install_command.feature +17 -0
  18. data/{features → config/features}/support/env.rb +8 -3
  19. data/config/features/test_command.feature +44 -0
  20. data/lib/busser/bats/version.rb +1 -5
  21. data/lib/busser/runner_plugin/bats.rb +3 -4
  22. data/renovate.json +8 -0
  23. data/vendor/bats/.travis.yml +5 -0
  24. data/vendor/bats/LICENSE +1 -1
  25. data/vendor/bats/README.md +34 -13
  26. data/vendor/bats/VERSION.txt +1 -1
  27. data/vendor/bats/bin/bats +1 -0
  28. data/vendor/bats/install.sh +3 -1
  29. data/vendor/bats/libexec/bats +4 -2
  30. data/vendor/bats/libexec/bats-exec-suite +3 -3
  31. data/vendor/bats/libexec/bats-exec-test +151 -12
  32. data/vendor/bats/libexec/bats-format-tap-stream +13 -6
  33. data/vendor/bats/libexec/bats-preprocess +6 -5
  34. data/vendor/bats/man/Makefile +10 -0
  35. data/vendor/bats/man/README.md +5 -0
  36. data/vendor/bats/man/bats.1 +101 -0
  37. data/vendor/bats/man/bats.1.ronn +109 -0
  38. data/vendor/bats/man/bats.7 +178 -0
  39. data/vendor/bats/man/bats.7.ronn +156 -0
  40. data/vendor/bats/package.json +9 -0
  41. metadata +29 -103
  42. data/.cane +0 -0
  43. data/.tailor +0 -4
  44. data/.travis.yml +0 -11
  45. data/features/plugin_install_command.feature +0 -14
  46. data/features/test_command.feature +0 -44
  47. data/vendor/bats/bin/bats +0 -140
  48. /data/{features → config/features}/plugin_list_command.feature +0 -0
@@ -2,7 +2,7 @@
2
2
  set -e
3
3
 
4
4
  version() {
5
- echo "Bats 0.3.1"
5
+ echo "Bats 0.4.0"
6
6
  }
7
7
 
8
8
  usage() {
@@ -54,6 +54,7 @@ expand_path() {
54
54
 
55
55
  BATS_LIBEXEC="$(abs_dirname "$0")"
56
56
  export BATS_PREFIX="$(abs_dirname "$BATS_LIBEXEC")"
57
+ export BATS_CWD="$(abs_dirname .)"
57
58
  export PATH="$BATS_LIBEXEC:$PATH"
58
59
 
59
60
  options=()
@@ -67,7 +68,7 @@ for arg in "$@"; do
67
68
  while option="${arg:$index:1}"; do
68
69
  [ -n "$option" ] || break
69
70
  options[${#options[*]}]="$option"
70
- index=$(($index+1))
71
+ let index+=1
71
72
  done
72
73
  fi
73
74
  else
@@ -77,6 +78,7 @@ done
77
78
 
78
79
  unset count_flag pretty
79
80
  [ -t 0 ] && [ -t 1 ] && pretty="1"
81
+ [ -n "$CI" ] && pretty=""
80
82
 
81
83
  for option in "${options[@]}"; do
82
84
  case "$option" in
@@ -17,7 +17,7 @@ trap "kill 0; exit 1" int
17
17
 
18
18
  count=0
19
19
  for filename in "$@"; do
20
- count=$(($count + $(bats-exec-test -c "$filename")))
20
+ let count+="$(bats-exec-test -c "$filename")"
21
21
  done
22
22
 
23
23
  if [ -n "$count_only_flag" ]; then
@@ -35,11 +35,11 @@ for filename in "$@"; do
35
35
  while IFS= read -r line; do
36
36
  case "$line" in
37
37
  "begin "* )
38
- index=$(($index + 1))
38
+ let index+=1
39
39
  echo "${line/ $index / $(($offset + $index)) }"
40
40
  ;;
41
41
  "ok "* | "not ok "* )
42
- [ -n "$extended_syntax_flag" ] || index=$(($index + 1))
42
+ [ -n "$extended_syntax_flag" ] || let index+=1
43
43
  echo "${line/ $index / $(($offset + $index)) }"
44
44
  [ "${line:0:6}" != "not ok" ] || status=1
45
45
  ;;
@@ -30,13 +30,21 @@ BATS_TEST_DIRNAME="$(dirname "$BATS_TEST_FILENAME")"
30
30
  BATS_TEST_NAMES=()
31
31
 
32
32
  load() {
33
- local filename="$BATS_TEST_DIRNAME/$1.bash"
33
+ local name="$1"
34
+ local filename
35
+
36
+ if [ "${name:0:1}" = "/" ]; then
37
+ filename="${name}"
38
+ else
39
+ filename="$BATS_TEST_DIRNAME/${name}.bash"
40
+ fi
41
+
34
42
  [ -f "$filename" ] || {
35
43
  echo "bats: $filename does not exist" >&2
36
44
  exit 1
37
45
  }
38
46
 
39
- source "$BATS_TEST_DIRNAME/$1.bash"
47
+ source "${filename}"
40
48
  }
41
49
 
42
50
  run() {
@@ -82,20 +90,150 @@ bats_test_function() {
82
90
  BATS_TEST_NAMES["${#BATS_TEST_NAMES[@]}"]="$test_name"
83
91
  }
84
92
 
93
+ bats_capture_stack_trace() {
94
+ BATS_PREVIOUS_STACK_TRACE=( "${BATS_CURRENT_STACK_TRACE[@]}" )
95
+ BATS_CURRENT_STACK_TRACE=()
96
+
97
+ local test_pattern=" $BATS_TEST_NAME $BATS_TEST_SOURCE"
98
+ local setup_pattern=" setup $BATS_TEST_SOURCE"
99
+ local teardown_pattern=" teardown $BATS_TEST_SOURCE"
100
+
101
+ local frame
102
+ local index=1
103
+
104
+ while frame="$(caller "$index")"; do
105
+ BATS_CURRENT_STACK_TRACE["${#BATS_CURRENT_STACK_TRACE[@]}"]="$frame"
106
+ if [[ "$frame" = *"$test_pattern" || \
107
+ "$frame" = *"$setup_pattern" || \
108
+ "$frame" = *"$teardown_pattern" ]]; then
109
+ break
110
+ else
111
+ let index+=1
112
+ fi
113
+ done
114
+
115
+ BATS_SOURCE="$(bats_frame_filename "${BATS_CURRENT_STACK_TRACE[0]}")"
116
+ BATS_LINENO="$(bats_frame_lineno "${BATS_CURRENT_STACK_TRACE[0]}")"
117
+ }
118
+
119
+ bats_print_stack_trace() {
120
+ local frame
121
+ local index=1
122
+ local count="${#@}"
123
+
124
+ for frame in "$@"; do
125
+ local filename="$(bats_trim_filename "$(bats_frame_filename "$frame")")"
126
+ local lineno="$(bats_frame_lineno "$frame")"
127
+
128
+ if [ $index -eq 1 ]; then
129
+ echo -n "# ("
130
+ else
131
+ echo -n "# "
132
+ fi
133
+
134
+ local fn="$(bats_frame_function "$frame")"
135
+ if [ "$fn" != "$BATS_TEST_NAME" ]; then
136
+ echo -n "from function \`$fn' "
137
+ fi
138
+
139
+ if [ $index -eq $count ]; then
140
+ echo "in test file $filename, line $lineno)"
141
+ else
142
+ echo "in file $filename, line $lineno,"
143
+ fi
144
+
145
+ let index+=1
146
+ done
147
+ }
148
+
149
+ bats_print_failed_command() {
150
+ local frame="$1"
151
+ local status="$2"
152
+ local filename="$(bats_frame_filename "$frame")"
153
+ local lineno="$(bats_frame_lineno "$frame")"
154
+
155
+ local failed_line="$(bats_extract_line "$filename" "$lineno")"
156
+ local failed_command="$(bats_strip_string "$failed_line")"
157
+ echo -n "# \`${failed_command}' "
158
+
159
+ if [ $status -eq 1 ]; then
160
+ echo "failed"
161
+ else
162
+ echo "failed with status $status"
163
+ fi
164
+ }
165
+
166
+ bats_frame_lineno() {
167
+ local frame="$1"
168
+ local lineno="${frame%% *}"
169
+ echo "$lineno"
170
+ }
171
+
172
+ bats_frame_function() {
173
+ local frame="$1"
174
+ local rest="${frame#* }"
175
+ local fn="${rest%% *}"
176
+ echo "$fn"
177
+ }
178
+
179
+ bats_frame_filename() {
180
+ local frame="$1"
181
+ local rest="${frame#* }"
182
+ local filename="${rest#* }"
183
+
184
+ if [ "$filename" = "$BATS_TEST_SOURCE" ]; then
185
+ echo "$BATS_TEST_FILENAME"
186
+ else
187
+ echo "$filename"
188
+ fi
189
+ }
190
+
191
+ bats_extract_line() {
192
+ local filename="$1"
193
+ local lineno="$2"
194
+ sed -n "${lineno}p" "$filename"
195
+ }
196
+
197
+ bats_strip_string() {
198
+ local string="$1"
199
+ printf "%s" "$string" | sed -e "s/^[ "$'\t'"]*//" -e "s/[ "$'\t'"]*$//"
200
+ }
201
+
202
+ bats_trim_filename() {
203
+ local filename="$1"
204
+ local length="${#BATS_CWD}"
205
+
206
+ if [ "${filename:0:length+1}" = "${BATS_CWD}/" ]; then
207
+ echo "${filename:length+1}"
208
+ else
209
+ echo "$filename"
210
+ fi
211
+ }
212
+
85
213
  bats_debug_trap() {
86
214
  if [ "$BASH_SOURCE" != "$1" ]; then
87
- BATS_LINE_NUMBER="$BATS_LINE_NUMBER_"
88
- BATS_LINE_NUMBER_="$2"
215
+ bats_capture_stack_trace
89
216
  fi
90
217
  }
91
218
 
92
219
  bats_error_trap() {
220
+ BATS_ERROR_STATUS="$?"
221
+ BATS_ERROR_STACK_TRACE=( "${BATS_PREVIOUS_STACK_TRACE[@]}" )
93
222
  trap - debug
94
223
  }
95
224
 
96
225
  bats_teardown_trap() {
97
- trap bats_exit_trap exit
98
- teardown >>"$BATS_OUT" 2>&1
226
+ trap "bats_exit_trap" exit
227
+ local status=0
228
+ teardown >>"$BATS_OUT" 2>&1 || status="$?"
229
+
230
+ if [ $status -eq 0 ]; then
231
+ BATS_TEARDOWN_COMPLETED=1
232
+ elif [ -n "$BATS_TEST_COMPLETED" ]; then
233
+ BATS_ERROR_STATUS="$status"
234
+ BATS_ERROR_STACK_TRACE=( "${BATS_CURRENT_STACK_TRACE[@]}" )
235
+ fi
236
+
99
237
  bats_exit_trap
100
238
  }
101
239
 
@@ -112,9 +250,10 @@ bats_exit_trap() {
112
250
  fi
113
251
  fi
114
252
 
115
- if [ -z "$BATS_TEST_COMPLETED" ]; then
253
+ if [ -z "$BATS_TEST_COMPLETED" ] || [ -z "$BATS_TEARDOWN_COMPLETED" ]; then
116
254
  echo "not ok $BATS_TEST_NUMBER $BATS_TEST_DESCRIPTION" >&3
117
- echo "# (in test file $BATS_TEST_FILENAME, line $BATS_LINE_NUMBER)" >&3
255
+ bats_print_stack_trace "${BATS_ERROR_STACK_TRACE[@]}" >&3
256
+ bats_print_failed_command "${BATS_ERROR_STACK_TRACE[${#BATS_ERROR_STACK_TRACE[@]}-1]}" "$BATS_ERROR_STATUS" >&3
118
257
  sed -e "s/^/# /" < "$BATS_OUT" >&3
119
258
  status=1
120
259
  else
@@ -132,7 +271,7 @@ bats_perform_tests() {
132
271
  status=0
133
272
  for test_name in "$@"; do
134
273
  "$0" $BATS_EXTENDED_SYNTAX "$BATS_TEST_FILENAME" "$test_name" "$test_number" || status=1
135
- test_number=$(($test_number + 1))
274
+ let test_number+=1
136
275
  done
137
276
  exit "$status"
138
277
  }
@@ -147,8 +286,8 @@ bats_perform_test() {
147
286
  fi
148
287
 
149
288
  BATS_TEST_COMPLETED=""
150
- BATS_ERROR_LINE=""
151
- trap "bats_debug_trap \"\$BASH_SOURCE\" \$LINENO" debug
289
+ BATS_TEARDOWN_COMPLETED=""
290
+ trap "bats_debug_trap \"\$BASH_SOURCE\"" debug
152
291
  trap "bats_error_trap" err
153
292
  trap "bats_teardown_trap" exit
154
293
  "$BATS_TEST_NAME" >>"$BATS_OUT" 2>&1
@@ -173,7 +312,7 @@ BATS_OUT="${BATS_TMPNAME}.out"
173
312
  bats_preprocess_source() {
174
313
  BATS_TEST_SOURCE="${BATS_TMPNAME}.src"
175
314
  { tr -d '\r' < "$BATS_TEST_FILENAME"; echo; } | bats-preprocess > "$BATS_TEST_SOURCE"
176
- trap bats_cleanup_preprocessed_source err exit
315
+ trap "bats_cleanup_preprocessed_source" err exit
177
316
  trap "bats_cleanup_preprocessed_source; exit 1" int
178
317
  }
179
318
 
@@ -11,6 +11,7 @@ if [[ "$header" =~ $header_pattern ]]; then
11
11
  count="${header:3}"
12
12
  index=0
13
13
  failures=0
14
+ skipped=0
14
15
  name=""
15
16
  count_column_width=$(( ${#count} * 2 + 2 ))
16
17
  else
@@ -64,9 +65,15 @@ log() {
64
65
  }
65
66
 
66
67
  summary() {
67
- printf "\n%d test%s, %d failure%s\n" \
68
- "$count" "$(plural "$count")" \
69
- "$failures" "$(plural "$failures")"
68
+ printf "\n%d test%s" "$count" "$(plural "$count")"
69
+
70
+ printf ", %d failure%s" "$failures" "$(plural "$failures")"
71
+
72
+ if [ "$skipped" -gt 0 ]; then
73
+ printf ", %d skipped" "$skipped"
74
+ fi
75
+
76
+ printf "\n"
70
77
  }
71
78
 
72
79
  printf_with_truncation() {
@@ -131,7 +138,7 @@ trap finish EXIT
131
138
  while IFS= read -r line; do
132
139
  case "$line" in
133
140
  "begin "* )
134
- index=$(( $index + 1 ))
141
+ let index+=1
135
142
  name="${line#* $index }"
136
143
  buffer begin
137
144
  flush
@@ -139,17 +146,17 @@ while IFS= read -r line; do
139
146
  "ok "* )
140
147
  skip_expr="ok $index # skip (\(([^)]*)\))?"
141
148
  if [[ "$line" =~ $skip_expr ]]; then
149
+ let skipped+=1
142
150
  buffer skip "${BASH_REMATCH[2]}"
143
151
  else
144
152
  buffer pass
145
153
  fi
146
154
  ;;
147
155
  "not ok "* )
148
- failures=$(( $failures + 1 ))
156
+ let failures+=1
149
157
  buffer fail
150
158
  ;;
151
159
  "# "* )
152
-
153
160
  buffer log "${line:2}"
154
161
  ;;
155
162
  esac
@@ -31,16 +31,17 @@ encode_name() {
31
31
 
32
32
  tests=()
33
33
  index=0
34
+ pattern='^ *@test *([^ ].*) *\{ *(.*)$'
34
35
 
35
36
  while IFS= read -r line; do
36
- index=$(($index + 1))
37
- quoted_name="$(expr "$line" : ' *@test *\([^ ].*\) *{ *$' || true)"
38
-
39
- if [ -n "$quoted_name" ]; then
37
+ let index+=1
38
+ if [[ "$line" =~ $pattern ]]; then
39
+ quoted_name="${BASH_REMATCH[1]}"
40
+ body="${BASH_REMATCH[2]}"
40
41
  name="$(eval echo "$quoted_name")"
41
42
  encoded_name="$(encode_name "$name")"
42
43
  tests["${#tests[@]}"]="$encoded_name"
43
- echo "${encoded_name}() { bats_test_begin ${quoted_name} ${index}"
44
+ echo "${encoded_name}() { bats_test_begin ${quoted_name} ${index}; ${body}"
44
45
  else
45
46
  printf "%s\n" "$line"
46
47
  fi
@@ -0,0 +1,10 @@
1
+ RONN := ronn
2
+ PAGES := bats.1 bats.7
3
+
4
+ all: $(PAGES)
5
+
6
+ bats.1: bats.1.ronn
7
+ $(RONN) -r $<
8
+
9
+ bats.7: bats.7.ronn
10
+ $(RONN) -r $<
@@ -0,0 +1,5 @@
1
+ Bats man pages are generated with [Ronn](http://rtomayko.github.io/ronn/).
2
+
3
+ After making changes to `bats.1.ronn` or `bats.7.ronn`, run `make` in
4
+ this directory to generate `bats.1` and `bats.7`. **Do not edit the
5
+ `bats.1` or `bats.7` files directly.**
@@ -0,0 +1,101 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "BATS" "1" "August 2014" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBbats\fR \- Bash Automated Testing System
8
+ .
9
+ .SH "SYNOPSIS"
10
+ bats [\-c] [\-p | \-t] \fItest\fR [\fItest\fR \.\.\.]
11
+ .
12
+ .P
13
+ \fItest\fR is the path to a Bats test file, or the path to a directory containing Bats test files\.
14
+ .
15
+ .SH "DESCRIPTION"
16
+ Bats is a TAP\-compliant testing framework for Bash\. It provides a simple way to verify that the UNIX programs you write behave as expected\.
17
+ .
18
+ .P
19
+ A Bats test file is a Bash script with special syntax for defining test cases\. Under the hood, each test case is just a function with a description\.
20
+ .
21
+ .P
22
+ Test cases consist of standard shell commands\. Bats makes use of Bash\'s \fBerrexit\fR (\fBset \-e\fR) option when running test cases\. If every command in the test case exits with a \fB0\fR status code (success), the test passes\. In this way, each line is an assertion of truth\.
23
+ .
24
+ .P
25
+ See \fBbats\fR(7) for more information on writing Bats tests\.
26
+ .
27
+ .SH "RUNNING TESTS"
28
+ To run your tests, invoke the \fBbats\fR interpreter with a path to a test file\. The file\'s test cases are run sequentially and in isolation\. If all the test cases pass, \fBbats\fR exits with a \fB0\fR status code\. If there are any failures, \fBbats\fR exits with a \fB1\fR status code\.
29
+ .
30
+ .P
31
+ You can invoke the \fBbats\fR interpreter with multiple test file arguments, or with a path to a directory containing multiple \fB\.bats\fR files\. Bats will run each test file individually and aggregate the results\. If any test case fails, \fBbats\fR exits with a \fB1\fR status code\.
32
+ .
33
+ .SH "OPTIONS"
34
+ .
35
+ .TP
36
+ \fB\-c\fR, \fB\-\-count\fR
37
+ Count the number of test cases without running any tests
38
+ .
39
+ .TP
40
+ \fB\-h\fR, \fB\-\-help\fR
41
+ Display help message
42
+ .
43
+ .TP
44
+ \fB\-p\fR, \fB\-\-pretty\fR
45
+ Show results in pretty format (default for terminals)
46
+ .
47
+ .TP
48
+ \fB\-t\fR, \fB\-\-tap\fR
49
+ Show results in TAP format
50
+ .
51
+ .TP
52
+ \fB\-v\fR, \fB\-\-version\fR
53
+ Display the version number
54
+ .
55
+ .SH "OUTPUT"
56
+ When you run Bats from a terminal, you\'ll see output as each test is performed, with a check\-mark next to the test\'s name if it passes or an "X" if it fails\.
57
+ .
58
+ .IP "" 4
59
+ .
60
+ .nf
61
+
62
+ $ bats addition\.bats
63
+ ✓ addition using bc
64
+ ✓ addition using dc
65
+
66
+ 2 tests, 0 failures
67
+ .
68
+ .fi
69
+ .
70
+ .IP "" 0
71
+ .
72
+ .P
73
+ If Bats is not connected to a terminal\-\-in other words, if you run it from a continuous integration system or redirect its output to a file\-\-the results are displayed in human\-readable, machine\-parsable TAP format\. You can force TAP output from a terminal by invoking Bats with the \fB\-\-tap\fR option\.
74
+ .
75
+ .IP "" 4
76
+ .
77
+ .nf
78
+
79
+ $ bats \-\-tap addition\.bats
80
+ 1\.\.2
81
+ ok 1 addition using bc
82
+ ok 2 addition using dc
83
+ .
84
+ .fi
85
+ .
86
+ .IP "" 0
87
+ .
88
+ .SH "EXIT STATUS"
89
+ The \fBbats\fR interpreter exits with a value of \fB0\fR if all test cases pass, or \fB1\fR if one or more test cases fail\.
90
+ .
91
+ .SH "SEE ALSO"
92
+ Bats wiki: \fIhttps://github\.com/sstephenson/bats/wiki/\fR
93
+ .
94
+ .P
95
+ \fBbash\fR(1), \fBbats\fR(7)
96
+ .
97
+ .SH "COPYRIGHT"
98
+ (c) 2014 Sam Stephenson
99
+ .
100
+ .P
101
+ Bats is released under the terms of an MIT\-style license\.
@@ -0,0 +1,109 @@
1
+ bats(1) -- Bash Automated Testing System
2
+ ========================================
3
+
4
+
5
+ SYNOPSIS
6
+ --------
7
+
8
+ bats [-c] [-p | -t] <test> [<test> ...]
9
+
10
+ <test> is the path to a Bats test file, or the path to a directory
11
+ containing Bats test files.
12
+
13
+
14
+ DESCRIPTION
15
+ -----------
16
+
17
+ Bats is a TAP-compliant testing framework for Bash. It provides a simple
18
+ way to verify that the UNIX programs you write behave as expected.
19
+
20
+ A Bats test file is a Bash script with special syntax for defining
21
+ test cases. Under the hood, each test case is just a function with a
22
+ description.
23
+
24
+ Test cases consist of standard shell commands. Bats makes use of
25
+ Bash's `errexit` (`set -e`) option when running test cases. If every
26
+ command in the test case exits with a `0` status code (success), the
27
+ test passes. In this way, each line is an assertion of truth.
28
+
29
+ See `bats`(7) for more information on writing Bats tests.
30
+
31
+
32
+ RUNNING TESTS
33
+ -------------
34
+
35
+ To run your tests, invoke the `bats` interpreter with a path to a test
36
+ file. The file's test cases are run sequentially and in isolation. If
37
+ all the test cases pass, `bats` exits with a `0` status code. If there
38
+ are any failures, `bats` exits with a `1` status code.
39
+
40
+ You can invoke the `bats` interpreter with multiple test file arguments,
41
+ or with a path to a directory containing multiple `.bats` files. Bats
42
+ will run each test file individually and aggregate the results. If any
43
+ test case fails, `bats` exits with a `1` status code.
44
+
45
+
46
+ OPTIONS
47
+ -------
48
+
49
+ * `-c`, `--count`:
50
+ Count the number of test cases without running any tests
51
+ * `-h`, `--help`:
52
+ Display help message
53
+ * `-p`, `--pretty`:
54
+ Show results in pretty format (default for terminals)
55
+ * `-t`, `--tap`:
56
+ Show results in TAP format
57
+ * `-v`, `--version`:
58
+ Display the version number
59
+
60
+
61
+ OUTPUT
62
+ ------
63
+
64
+ When you run Bats from a terminal, you'll see output as each test is
65
+ performed, with a check-mark next to the test's name if it passes or
66
+ an "X" if it fails.
67
+
68
+ $ bats addition.bats
69
+ ✓ addition using bc
70
+ ✓ addition using dc
71
+
72
+ 2 tests, 0 failures
73
+
74
+ If Bats is not connected to a terminal--in other words, if you run it
75
+ from a continuous integration system or redirect its output to a
76
+ file--the results are displayed in human-readable, machine-parsable
77
+ TAP format. You can force TAP output from a terminal by invoking Bats
78
+ with the `--tap` option.
79
+
80
+ $ bats --tap addition.bats
81
+ 1..2
82
+ ok 1 addition using bc
83
+ ok 2 addition using dc
84
+
85
+
86
+ EXIT STATUS
87
+ -----------
88
+
89
+ The `bats` interpreter exits with a value of `0` if all test cases pass,
90
+ or `1` if one or more test cases fail.
91
+
92
+
93
+ SEE ALSO
94
+ --------
95
+
96
+ Bats wiki: _https://github.com/sstephenson/bats/wiki/_
97
+
98
+ `bash`(1), `bats`(7)
99
+
100
+
101
+ COPYRIGHT
102
+ ---------
103
+
104
+ (c) 2014 Sam Stephenson
105
+
106
+ Bats is released under the terms of an MIT-style license.
107
+
108
+
109
+