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:754–777  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

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