| 829 | |
| 830 | #[test] |
| 831 | fn test_enable_force_reinstall() { |
| 832 | let dir = tempfile::TempDir::new().unwrap(); |
| 833 | std::fs::create_dir_all(dir.path().join(".atomic")).unwrap(); |
| 834 | std::fs::create_dir_all(dir.path().join(".claude")).unwrap(); |
| 835 | |
| 836 | let registry = AgentRegistry::with_defaults(); |
| 837 | let agent = registry.get("claude-code").unwrap(); |
| 838 | |
| 839 | // First install |
| 840 | let count1 = agent.install(dir.path()).unwrap(); |
| 841 | assert_eq!(count1, 8); |
| 842 | |
| 843 | // Second install without force — should be 0 |
| 844 | let count2 = agent.install(dir.path()).unwrap(); |
| 845 | assert_eq!(count2, 0); |
| 846 | |
| 847 | // Uninstall and reinstall (simulating --force) |
| 848 | agent.uninstall(dir.path()).unwrap(); |
| 849 | assert!(!agent.is_installed(dir.path())); |
| 850 | |
| 851 | let count3 = agent.install(dir.path()).unwrap(); |
| 852 | assert_eq!(count3, 8); |
| 853 | assert!(agent.is_installed(dir.path())); |
| 854 | } |
| 855 | |
| 856 | #[test] |
| 857 | fn test_receipt_managed_codex_repair_uses_recorded_target() { |