---
id: TASK-8.2
title: Add tests for full build-dir clean behavior
status: Done
assignee:
  - codex
created_date: '2026-02-03 17:47'
updated_date: '2026-02-03 18:05'
labels:
  - tests
  - clean
  - build
  - profiles
dependencies:
  - TASK-8.1
references:
  - spec/
parent_task_id: TASK-8
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add or update Busted tests to verify `zync clean` removes the entire build directory for profile-less and build-profile projects, while `-c/--clean` pre-clean remains targeted.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Tests cover `zync clean` removing `./build` for a profile-less project.
- [x] #2 Tests cover `zync clean` removing `./build` with profile subdirectories for a build-profile project.
- [x] #3 Tests cover `-c/--clean` still cleaning only the selected build directory when running another command.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
- Locate existing clean/--clean specs under spec/ and identify fixtures for profile-less vs build-profile projects.
- Add/extend Busted specs to assert zync clean removes full ./build for a profile-less project.
- Add/extend Busted specs to assert zync clean removes full ./build including profile subdirs for a build-profile project.
- Add/extend a spec to assert -c/--clean pre-clean only removes the selected build directory when running another command.
- Run busted and update acceptance criteria/notes as each item is met.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added zync clean/pre-clean behavior tests in spec/zync_spec.lua covering profile-less clean, profile clean removing build/, and pre-clean preserving other profiles.

Tests: busted
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added zync clean coverage in spec/zync_spec.lua for profile-less and profile-based projects, asserting clean removes the full build directory. Added a pre-clean test that verifies only the selected profile build output is cleaned while other profile build dirs remain intact. Tests: busted.
<!-- SECTION:FINAL_SUMMARY:END -->
