Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bats-core/bats-support.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/README.md b/README.md
index bb8fcc1..cd3fee1 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ them. Version numbering continues where `bats-core` left off.*
test helper libraries written for [Bats][bats].
Features:
+- [error reporting](#error-reporting)
- [output formatting](#output-formatting)
See the [shared documentation][bats-docs] to learn how to install and
@@ -27,6 +28,36 @@ learn about its internals see the developer documentation in the [source
files](src).
+## Error reporting
+
+### `fail`
+
+Display an error message and fail. This function provides a convenient
+way to report failure in arbitrary situations. You can use it to
+implement your own helpers when the ones available do not meet your
+needs. Other functions use it internally as well.
+
+```bash
+@test 'fail()' {
+ fail 'this test always fails'
+}
+```
+
+The message can also be specified on the standard input.
+
+```bash
+@test 'fail() with pipe' {
+ echo 'this test always fails' | fail
+}
+```
+
+This function always fails and simply outputs the given message.
+
+```
+this test always fails
+```
+
+
## Output formatting
Many test helpers need to produce human readable output. This library