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

Source from the content-addressed store, hash-verified

681
682 #[test]
683 fn test_enable_force_reinstall() {
684 let dir = tempfile::TempDir::new().unwrap();
685 std::fs::create_dir_all(dir.path().join(".atomic")).unwrap();
686 std::fs::create_dir_all(dir.path().join(".claude")).unwrap();
687
688 let registry = AgentRegistry::with_defaults();
689 let agent = registry.get("claude-code").unwrap();
690
691 // First install
692 let count1 = agent.install(dir.path()).unwrap();
693 assert_eq!(count1, 8);
694
695 // Second install without force — should be 0
696 let count2 = agent.install(dir.path()).unwrap();
697 assert_eq!(count2, 0);
698
699 // Uninstall and reinstall (simulating --force)
700 agent.uninstall(dir.path()).unwrap();
701 assert!(!agent.is_installed(dir.path()));
702
703 let count3 = agent.install(dir.path()).unwrap();
704 assert_eq!(count3, 8);
705 assert!(agent.is_installed(dir.path()));
706 }
707}

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