command -v ssh > /dev/null \
|| errlog "command ssh not found" \
|| return $?
+ command -v savelog > /dev/null \
+ || errlog "command savelog not found" \
+ || return $?
}
exists_config_file()
assert_line --index 1 "❌ ERROR: command ssh not found"
}
+# bats test_tags=backup:start,backup:savelog
+@test "failure savelog command not found" {
+ command() {
+ [ "$2" != "savelog" ] || return 1
+ }
+
+ run main
+
+ assert_failure
+ assert_line --index 0 "⭐ START: backup"
+ assert_line --index 1 "❌ ERROR: command savelog not found"
+}
+
# bats test_tags=backup:start,backup:config
@test "failure config.yaml not found" {
exists_config_file() {