Skip to content

Commit

Permalink
Fix messed up PR #670
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-schulze-vireso committed Oct 22, 2022
1 parent 56954a7 commit 7010744
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
/bats-*.tgz
# we don't have any deps; un-ignore if that changes
/package-lock.json
test/.bats/run-logs/
test/.bats/run-logs/
# scratch file that should never be committed
/test.bats
14 changes: 7 additions & 7 deletions docs/source/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ is not yet upgraded.

## Code outside of test cases

In general you should avoid code outside tests, because it will be evaluated many times.
However, there are situations in which this might be useful, e.g. when you want to check for dependencies and fail
immediately if they're not present.
In general you should avoid code outside tests, because each test file will be evaluated many times.
However, there are situations in which this might be useful, e.g. when you want to check for dependencies
and fail immediately if they're not present.

However, you should avoid printing outside of `@test`, `setup*` or `teardown*` functions.
In general, you should avoid printing outside of `@test`, `setup*` or `teardown*` functions.
Have a look at section [printing to the terminal](#printing-to-the-terminal) for more details.
## File descriptor 3 (read this if Bats hangs)

Expand Down Expand Up @@ -474,10 +474,10 @@ your custom text. Here are some detailed guidelines to refer to:
contexts (`setup_file`, multiple `@test`s) of test files, output
will be printed more than once.

- Regardless of where text is redirected to
(stdout, stderr or file descriptor 3) text is immediately visible in the terminal, as it is not piped into the formatter.
- Regardless of where text is redirected to (stdout, stderr or file descriptor 3)
text is immediately visible in the terminal, as it is not piped into the formatter.

- Text printed to stdout, may interfere with formatters as it can
- Text printed to stdout may interfere with formatters as it can
make output non-compliant with the TAP spec. The reason for this is that
such output will be produced before the [_plan line_][tap-plan] is printed,
contrary to the spec that requires the _plan line_ to be either the first or
Expand Down
7 changes: 0 additions & 7 deletions test.bats

This file was deleted.

0 comments on commit 7010744

Please sign in to comment.