mod testsupport;
use assert_cmd::cargo_bin_cmd;
use std::path::Path;
use tempfile::TempDir;
#[tokio::test]
async fn can_generate_then_delete_a_model() {
testsupport::require_acceptance_testing_enabled!();
let tempdir = TempDir::new().expect("failed to create temp dir");
let workspace = tempdir.path().join("my-app");
std::fs::create_dir_all(&workspace).expect("Expected to create temp dir for workspace");
let auric_cli_path = Path::new(env!("CARGO_MANIFEST_DIR"));
let auric_workspace_path = auric_cli_path
.join("../..")
.canonicalize()
.expect("Expected to get absolute workspace path");
cargo_bin_cmd!("auric")
.arg("init")
.arg("--auricWorkspace")
.arg(&auric_workspace_path)
.current_dir(&workspace)
.assert()
.success();
const MODEL_NAME: &str = "foo";
cargo_bin_cmd!("auric")
.arg("generate")
.arg("model")
.arg(MODEL_NAME)
.current_dir(&workspace)
.assert()
.success();
cargo_bin_cmd!("auric")
.arg("delete")
.arg("model")
.arg(MODEL_NAME)
.current_dir(&workspace)
.assert()
.success();
}