| 809 | |
| 810 | #[test] |
| 811 | fn test_enable_force_reinstall() { |
| 812 | let dir = tempfile::TempDir::new().unwrap(); |
| 813 | std::fs::create_dir_all(dir.path().join(".atomic")).unwrap(); |
| 814 | std::fs::create_dir_all(dir.path().join(".claude")).unwrap(); |
| 815 | |
| 816 | let registry = AgentRegistry::with_defaults(); |
| 817 | let agent = registry.get("claude-code").unwrap(); |
| 818 | |
| 819 | // First install |
| 820 | let count1 = agent.install(dir.path()).unwrap(); |
| 821 | assert_eq!(count1, 8); |
| 822 | |
| 823 | // Second install without force — should be 0 |
| 824 | let count2 = agent.install(dir.path()).unwrap(); |
| 825 | assert_eq!(count2, 0); |
| 826 | |
| 827 | // Uninstall and reinstall (simulating --force) |
| 828 | agent.uninstall(dir.path()).unwrap(); |
| 829 | assert!(!agent.is_installed(dir.path())); |
| 830 | |
| 831 | let count3 = agent.install(dir.path()).unwrap(); |
| 832 | assert_eq!(count3, 8); |
| 833 | assert!(agent.is_installed(dir.path())); |
| 834 | } |
| 835 | |
| 836 | #[test] |
| 837 | fn test_receipt_managed_codex_repair_uses_recorded_target() { |