use pretty_assertions::assert_eq;
use super::*;
#[test]
fn writes_the_allowlist_where_agy_discovers_agents() {
let run_dir = tempfile::tempdir().unwrap();
let tools = [AntigravityTool::ReadFile, AntigravityTool::RunCommand];
let agent = write(run_dir.path(), &tools).unwrap();
assert_eq!(agent.root, run_dir.path().join("agy"));
assert_eq!(
std::fs::read_to_string(agent.root.join(format!(".agents/agents/{}.md", agent.name)))
.unwrap(),
format!(
"---\nname: {}\ndescription: Rho delegated run.\ntools:\n - read_file\n - run_command\n---\n",
agent.name
)
);
assert_ne!(write(run_dir.path(), &tools).unwrap().name, agent.name);
}