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

Source from the content-addressed store, hash-verified

577
578 #[test]
579 fn test_enable_force_reinstall() {
580 let dir = tempfile::TempDir::new().unwrap();
581 std::fs::create_dir_all(dir.path().join(".atomic")).unwrap();
582 std::fs::create_dir_all(dir.path().join(".claude")).unwrap();
583
584 let registry = AgentRegistry::with_defaults();
585 let agent = registry.get("claude-code").unwrap();
586
587 // First install
588 let count1 = agent.install(dir.path()).unwrap();
589 assert_eq!(count1, 8);
590
591 // Second install without force — should be 0
592 let count2 = agent.install(dir.path()).unwrap();
593 assert_eq!(count2, 0);
594
595 // Uninstall and reinstall (simulating --force)
596 agent.uninstall(dir.path()).unwrap();
597 assert!(!agent.is_installed(dir.path()));
598
599 let count3 = agent.install(dir.path()).unwrap();
600 assert_eq!(count3, 8);
601 assert!(agent.is_installed(dir.path()));
602 }
603}

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