We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d240742 commit 098361aCopy full SHA for 098361a
_posts/2021-10-23-bats.md
@@ -0,0 +1,31 @@
1
+---
2
+layout: post
3
+title: "Bats"
4
+description: "A TAP-compliant testing framework for Bash."
5
+category: bash
6
+tags: [bash, testing, ci]
7
8
+## Usage
9
+Write tests into `*.bats` files like:
10
+
11
+```
12
+#!/usr/bin/env bats
13
14
+@test "addition using bc" {
15
+ result="$(echo 2+2 | bc)"
16
+ [ "$result" -eq 4 ]
17
+}
18
19
20
+Then run the test:
21
22
23
+$ bats test.bats
24
+ ✓ addition using bc
25
26
+1 test, 0 failures
27
28
29
+## Links
30
+* [Source Code (GitHub)][https://github.com/bats-core/bats-core]
31
+* [Documentation][https://bats-core.readthedocs.io/]
0 commit comments