feat: matcha new scaffolds from embedded starter

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-07-11 12:59:38 -05:00
1 parent caabb51ae0
commit 06849ebab4
3 files changed
+50 -1

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
use assert_cmd::Command;
use tempfile::tempdir;
#[test]
fn new_scaffolds_into_named_dir() {
let d = tempdir().unwrap();
Command::cargo_bin("matcha").unwrap()
.current_dir(d.path())
.args(["new", "my-api"]).assert().success();
let root = d.path().join("my-api");
assert!(root.join("src/app.module.ts").exists());
assert!(root.join("public/index.html").exists());
}
#[test]
fn new_refuses_existing_dir() {
let d = tempdir().unwrap();
std::fs::create_dir(d.path().join("taken")).unwrap();
Command::cargo_bin("matcha").unwrap()
.current_dir(d.path())
.args(["new", "taken"]).assert().failure();
}