use std::process::Command;
use tempfile::tempdir;
#[test]
fn test_cli_system_flow_init() {
let dir = tempdir().unwrap();
let root = dir.path();
let status = Command::new("cargo").arg("build").status().unwrap();
assert!(status.success());
let exe_name = if cfg!(windows) { "woven.exe" } else { "woven" };
let exe_path = std::env::current_dir()
.unwrap()
.join("target")
.join("debug")
.join(exe_name);
if !exe_path.exists() {
return;
}
let output = Command::new(&exe_path)
.arg("init")
.current_dir(root)
.output()
.expect("Failed to execute binary in temp dir");
assert!(output.status.success());
assert!(root.join("wovenpkg.json").exists());
}