From: Bastian Dehn Date: Mon, 3 Aug 2026 15:50:30 +0000 (+0200) Subject: add test command rsync check X-Git-Tag: v1.0.6^2~1^2~77 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=f1d24bf80e95246e8d372ca6e38e61517948c28c;p=simple-backup.git add test command rsync check --- diff --git a/src/backup b/src/backup index 9469b5a..ca33079 100755 --- a/src/backup +++ b/src/backup @@ -19,6 +19,9 @@ main() command -v jq > /dev/null \ || errlog "command jq not found" \ || return $? + command -v rsync > /dev/null \ + || errlog "command rsync not found" \ + || return $? } [ "$TESTMODE" == "ON" ] || return 0 diff --git a/tests/backup_tests.bats b/tests/backup_tests.bats index 31a0863..a2bdccb 100755 --- a/tests/backup_tests.bats +++ b/tests/backup_tests.bats @@ -47,3 +47,15 @@ teardown() { assert_line --index 0 "⭐ START: backup" assert_line --index 1 "❌ ERROR: command jq not found" } + +@test "failure rsync command not found" { + command() { + [ "$2" != "rsync" ] || return 1 + } + + run main + + assert_failure + assert_line --index 0 "⭐ START: backup" + assert_line --index 1 "❌ ERROR: command rsync not found" +}