command -v yq > /dev/null \
|| errlog "command yq not found" \
|| return $?
+ command -v jq > /dev/null \
+ || errlog "command jq not found" \
+ || return $?
}
[ "$TESTMODE" == "ON" ] || return 0
assert_failure
assert_line --index 0 "⭐ START: backup"
assert_line --index 1 "❌ ERROR: command yq not found"
-}
\ No newline at end of file
+}
+
+@test "failure jq command not found" {
+ command() {
+ [ "$2" != "jq" ] || return 1
+ }
+
+ run main
+
+ assert_failure
+ assert_line --index 0 "⭐ START: backup"
+ assert_line --index 1 "❌ ERROR: command jq not found"
+}