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

Source from the content-addressed store, hash-verified

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

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