Skip to content

Commit 0e2bc80

Browse files
committed
test: bashunit_exit_code
1 parent bd20674 commit 0e2bc80

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
function set_up_before_script() {
5+
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
6+
}
7+
8+
function test_bashunit_when_a_test_returns_non_zero() {
9+
local test_file=tests/acceptance/fixtures/test_bashunit_when_a_test_returns_non_zero.sh
10+
11+
assert_match_snapshot "$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file")"
12+
assert_general_error "$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file")"
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
function test_returns_non_zero() {
4+
return 1
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Running tests/acceptance/fixtures/test_bashunit_when_a_test_returns_non_zero.sh
2+
✗ Error: Returns non zero
3+

4+
5+
There was 1 failure:
6+
7+
|1) tests/acceptance/fixtures/test_bashunit_when_a_test_returns_non_zero.sh
8+
9+
Tests:  1 failed, 1 total
10+
Assertions: 0 failed, 0 total
11+
12+
 Some tests failed 

0 commit comments

Comments
 (0)