From 022b42687e956261690c6e770191f4c56eb0a5ed Mon Sep 17 00:00:00 2001 From: tw93 Date: Sat, 28 Feb 2026 11:45:26 +0800 Subject: [PATCH] test: mock defaults in tmutil tests to bypass early check added in #510 --- tests/clean_core.bats | 6 ++++++ tests/clean_system_maintenance.bats | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/clean_core.bats b/tests/clean_core.bats index 8da50b2..836c15e 100644 --- a/tests/clean_core.bats +++ b/tests/clean_core.bats @@ -267,6 +267,9 @@ set -euo pipefail source "$PROJECT_ROOT/lib/core/common.sh" source "$PROJECT_ROOT/lib/clean/system.sh" +defaults() { echo "1"; } + + clean_time_machine_failed_backups EOF @@ -310,6 +313,9 @@ set -euo pipefail source "$PROJECT_ROOT/lib/core/common.sh" source "$PROJECT_ROOT/lib/clean/system.sh" +defaults() { echo "1"; } + + clean_time_machine_failed_backups EOF diff --git a/tests/clean_system_maintenance.bats b/tests/clean_system_maintenance.bats index e0d9438..fb79662 100644 --- a/tests/clean_system_maintenance.bats +++ b/tests/clean_system_maintenance.bats @@ -274,6 +274,9 @@ set -euo pipefail source "$PROJECT_ROOT/lib/core/common.sh" source "$PROJECT_ROOT/lib/clean/system.sh" +defaults() { echo "1"; } + + tmutil() { if [[ "$1" == "destinationinfo" ]]; then echo "No destinations configured" @@ -297,6 +300,9 @@ set -euo pipefail source "$PROJECT_ROOT/lib/core/common.sh" source "$PROJECT_ROOT/lib/clean/system.sh" +defaults() { echo "1"; } + + run_with_timeout() { printf '%s\n' \ "com.apple.TimeMachine.2023-10-25-120000" \ @@ -321,6 +327,9 @@ set -euo pipefail source "$PROJECT_ROOT/lib/core/common.sh" source "$PROJECT_ROOT/lib/clean/system.sh" +defaults() { echo "1"; } + + run_with_timeout() { echo "Snapshots for disk /:"; } start_section_spinner(){ :; } stop_section_spinner(){ :; }