test(worktree): update tests for destroy→remove rename - #34
Conversation
Updates all BATS tests to use `remove` as the primary command. Adds dedicated alias test to verify `destroy` still works. Implements [[tasks/meta-63]] Co-authored-by: Claude <claude@anthropic.com>
WalkthroughTests updated to replace all "destroy" terminology with "remove" for git worktree operations, including command invocations, test names, directory references, and help output expectations; no functional test behavior changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryUpdates all worktree tests to use
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| tests/worktree.bats | Renames all destroy commands to remove in test suite and adds backward compatibility test for destroy alias |
Last reviewed commit: 9d5c3e8
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/worktree.bats`:
- Around line 376-428: In the "worktree remove preserves branches" test, the
remove call isn't checking its exit status; invoke the remove using the test
harness (use run "$META_BIN" git worktree remove keep-branch or capture $?
immediately) and add an assertion like [ "$status" -eq 0 ] (or equivalent)
before the subsequent git branch check to ensure the remove succeeded.
Addresses CodeRabbit review: use `run` and assert exit status before checking branch preservation. Co-authored-by: Claude <claude@anthropic.com>
|
Note: Merge ordering dependency The integration tests fail because CI clones Merge order: gitkb/meta_git_cli#17 first, then this PR. Integration tests will pass once CI picks up the updated |
Updates worktree_cloud.bats to use `remove` as the primary command, matching the rename done in worktree.bats. Fixes failing CI check for REMOVE OPTIONS help text assertion. Implements [[tasks/meta-63]] Co-authored-by: Claude <claude@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/worktree_cloud.bats (1)
295-318: 🧹 Nitpick | 🔵 TrivialStale comment: "Destroy" should be "Remove".
The inline comment at line 307 still says
# Destroybut the command now usesremove. Update for consistency.✏️ Suggested fix
python3 -c " import json with open('\$STORE') as f: data = json.load(f) assert any(v['name'] == 'store-rm' for v in data['worktrees'].values()) " - # Destroy + # Remove run "\$META_BIN" git worktree remove store-rm🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/worktree_cloud.bats` around lines 295 - 318, In the "@test \"worktree remove removes from centralized store\"" test update the inline comment that currently reads "# Destroy" to match the command and intent by changing it to "# Remove"; locate the block around the call to run "$META_BIN" git worktree remove store-rm and replace that single-line comment so the test comments remain consistent with the remove operation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@tests/worktree_cloud.bats`:
- Around line 295-318: In the "@test \"worktree remove removes from centralized
store\"" test update the inline comment that currently reads "# Destroy" to
match the command and intent by changing it to "# Remove"; locate the block
around the call to run "$META_BIN" git worktree remove store-rm and replace that
single-line comment so the test comments remain consistent with the remove
operation.
Summary
removeas the primary commanddestroystill works as a hidden aliasremoveinstead ofdestroyContext
Companion to gitkb/meta_git_cli#17 — part of [[tasks/meta-63]].
Test plan
bats tests/worktree.bats)destroybackward compat🤖 Generated with Claude Code
Summary by CodeRabbit