| 752 | |
| 753 | #[test] |
| 754 | fn test_enable_force_reinstall() { |
| 755 | let dir = tempfile::TempDir::new().unwrap(); |
| 756 | std::fs::create_dir_all(dir.path().join(".atomic")).unwrap(); |
| 757 | std::fs::create_dir_all(dir.path().join(".claude")).unwrap(); |
| 758 | |
| 759 | let registry = AgentRegistry::with_defaults(); |
| 760 | let agent = registry.get("claude-code").unwrap(); |
| 761 | |
| 762 | // First install |
| 763 | let count1 = agent.install(dir.path()).unwrap(); |
| 764 | assert_eq!(count1, 8); |
| 765 | |
| 766 | // Second install without force — should be 0 |
| 767 | let count2 = agent.install(dir.path()).unwrap(); |
| 768 | assert_eq!(count2, 0); |
| 769 | |
| 770 | // Uninstall and reinstall (simulating --force) |
| 771 | agent.uninstall(dir.path()).unwrap(); |
| 772 | assert!(!agent.is_installed(dir.path())); |
| 773 | |
| 774 | let count3 = agent.install(dir.path()).unwrap(); |
| 775 | assert_eq!(count3, 8); |
| 776 | assert!(agent.is_installed(dir.path())); |
| 777 | } |
| 778 | |
| 779 | #[test] |
| 780 | fn test_receipt_managed_codex_repair_uses_recorded_target() { |