feat: matcha new scaffolds from embedded starter
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
3 files changed
+50
-1
No files matched your search
@@ -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();
|
||||
}
|
||||
Reference in new issue
Block a user