MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_enable_force_reinstall

Function test_enable_force_reinstall

atomic-cli/src/commands/agent/enable.rs:811–834  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 5

getMethod · 0.65
unwrapMethod · 0.45
pathMethod · 0.45
installMethod · 0.45
uninstallMethod · 0.45

Tested by

no test coverage detected