Merged
Conversation
Add automated tests verifying critical requirements for the install process: - REQ-001: Install MUST NOT modify local (user home) Claude settings - REQ-002: Install MUST be idempotent for project settings These are REQUIREMENTS tests that protect user data integrity and ensure installation reliability. They should not be altered - if tests fail, fix the implementation, not the tests. Test coverage: - Local settings protection: verifies ~/.claude/settings.json is untouched - Project settings only: verifies only .claude/settings.json in project is modified - Idempotency: verifies second install produces identical settings - No duplicate hooks: verifies multiple installs don't create duplicates - Nth install stability: verifies settings are stable across many installs
Update the idempotency tests to verify that: - First install MUST actually modify settings (add hooks) - Only then verify subsequent installs don't change anything This prevents false positives where a broken install that does nothing would trivially pass idempotency tests. Also includes lint fixes.
Extract common patterns into reusable helpers: - run_install(): CLI invocation wrapper - get_project_settings(): Read and parse settings.json - assert_install_added_hooks(): Verify first install modified settings Reduces code by 36 lines while maintaining test clarity.
Extract redundant mock home directory setup into a reusable context manager that handles directory creation, settings file writing, and HOME environment patching in one place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add automated tests verifying critical requirements for the install process:
These are REQUIREMENTS tests that protect user data integrity and ensure installation reliability. They should not be altered - if tests fail, fix the implementation, not the tests.
Test coverage: