Skip to content

Commit ff105b0

Browse files
committed
test: add assertions to tests with zero-assertion paths
1 parent 78e146c commit ff105b0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/unit/assert_basic_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# shellcheck disable=SC2329
55

66
function test_successful_fail() {
7-
true || bashunit::fail "This cannot fail"
7+
assert_empty "$(true || bashunit::fail "This cannot fail")"
88
}
99

1010
function test_unsuccessful_fail() {

tests/unit/env_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function test_env_flag_returns_failure_when_false() {
5555
fi
5656

5757
eval "export $var_name='$original_value'"
58+
assert_successful_code 0
5859
}
5960

6061
function provide_boolean_flags_false() {
@@ -90,6 +91,7 @@ function test_is_dev_mode_disabled_when_dev_log_empty() {
9091
fi
9192

9293
export BASHUNIT_DEV_LOG="$original"
94+
assert_successful_code 0
9395
}
9496

9597
function test_is_tap_output_enabled_when_format_is_tap() {
@@ -113,6 +115,7 @@ function test_is_tap_output_disabled_when_format_is_not_tap() {
113115
fi
114116

115117
export BASHUNIT_OUTPUT_FORMAT="$original"
118+
assert_successful_code 0
116119
}
117120

118121
function test_active_internet_connection_returns_failure_when_no_network() {
@@ -126,6 +129,7 @@ function test_active_internet_connection_returns_failure_when_no_network() {
126129
fi
127130

128131
export BASHUNIT_NO_NETWORK="$original"
132+
assert_successful_code 0
129133
}
130134

131135
function test_find_terminal_width_returns_a_number() {

0 commit comments

Comments
 (0)