File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ layout : post
3+ title : " bashunit"
4+ description : " A simple testing library for bash scripts."
5+ category : bash
6+ tags : [bash, testing, ci]
7+ ---
8+
9+ ## Usage
10+
11+ Write tests files like:
12+
13+ ``` bash
14+ # file: tests/my_test.sh
15+
16+ function test_using_snake_case() {
17+ assertEquals " 1" " 1"
18+ assertContains " Linux" " GNU/Linux"
19+ }
20+
21+ function testUsingCamelCase() {
22+ assertNotContains " Linus" " GNU/Linux"
23+ assertMatches " .*Linu*" " GNU/Linux"
24+ assertExitCode " 0"
25+ }
26+ ```
27+
28+ Then run the test:
29+
30+ ``` bash
31+ $ bashunit tests/my_test.sh
32+
33+ Running logic_test.sh
34+ ✓ Passed: UsingCamelCase
35+ ✓ Passed: Using snake case
36+
37+ Tests: 2 passed, 2 total
38+ Assertions: 5 passed, 5 total
39+ All tests passed
40+ ` ` `
41+
42+ # # Links
43+
44+ * [Source Code (GitHub)](https://github.com/TypedDevs/bashunit)
45+ * Authors: [Jose Maria Valera Reales](https://github.com/Chemaclass), [Emmanuel Valverde Ramos](https://github.com/khru), [Antonio Gonzalez Gea
46+ ](https://github.com/Tito-Kati)
47+ * [Documentation](https://bashunit.typeddevs.com)
48+
49+ {% include JB/setup %}
50+
You can’t perform that action at this time.
0 commit comments