@@ -160,24 +160,50 @@ EOF
160160}
161161
162162@test " clean_dev_docker skips when daemon not running" {
163- run env HOME=" $HOME " PROJECT_ROOT=" $PROJECT_ROOT " MO_DEBUG=1 DRY_RUN=false bash --noprofile --norc << 'EOF '
163+ run env HOME=" $HOME " PROJECT_ROOT=" $PROJECT_ROOT " DRY_RUN=false bash --noprofile --norc << 'EOF '
164164set -euo pipefail
165165source "$PROJECT_ROOT/lib/core/common.sh"
166166source "$PROJECT_ROOT/lib/clean/dev.sh"
167167start_section_spinner() { :; }
168168stop_section_spinner() { :; }
169169run_with_timeout() { return 1; }
170- clean_tool_cache() { echo "$1"; }
171170safe_clean() { echo "$2"; }
172- debug_log() { echo "$*" ; }
171+ debug_log() { : ; }
173172docker() { return 1; }
174173export -f docker
175174clean_dev_docker
176175EOF
177176
178177 [ " $status " -eq 0 ]
179- [[ " $output " == * " Docker daemon not running" * ]]
180- [[ " $output " != * " Docker build cache" * ]]
178+ [[ " $output " == * " Docker unused data · skipped (daemon not running)" * ]]
179+ [[ " $output " == * " Docker BuildX cache" * ]]
180+ [[ " $output " != * " Docker unused data|Docker unused data docker system prune -af --volumes" * ]]
181+ }
182+
183+ @test " clean_dev_docker prunes unused docker data when daemon is running" {
184+ run env HOME=" $HOME " PROJECT_ROOT=" $PROJECT_ROOT " DRY_RUN=false bash --noprofile --norc << 'EOF '
185+ set -euo pipefail
186+ source "$PROJECT_ROOT/lib/core/common.sh"
187+ source "$PROJECT_ROOT/lib/clean/dev.sh"
188+ start_section_spinner() { :; }
189+ stop_section_spinner() { :; }
190+ run_with_timeout() { shift; "$@"; }
191+ clean_tool_cache() { echo "$1|$*"; }
192+ safe_clean() { :; }
193+ note_activity() { :; }
194+ debug_log() { :; }
195+ docker() {
196+ if [[ "$1" == "info" ]]; then
197+ return 0
198+ fi
199+ return 0
200+ }
201+ export -f docker
202+ clean_dev_docker
203+ EOF
204+
205+ [ " $status " -eq 0 ]
206+ [[ " $output " == * " Docker unused data|Docker unused data docker system prune -af --volumes" * ]]
181207}
182208
183209@test " clean_developer_tools runs key stages" {
0 commit comments