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