fix(new): no orphan dir on error path; drop stale dead_code allow
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
1 parent
7044e50982
commit
c382602ca7
3 files changed
+13
-3
No files matched your search
@@ -20,3 +20,12 @@ fn new_refuses_existing_dir() {
|
||||
.current_dir(d.path())
|
||||
.args(["new", "taken"]).assert().failure();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_with_template_url_stub_leaves_no_dir() {
|
||||
let d = tempdir().unwrap();
|
||||
Command::cargo_bin("matcha").unwrap()
|
||||
.current_dir(d.path())
|
||||
.args(["new", "demo", "--template-url", "gh:x/y"]).assert().failure();
|
||||
assert!(!d.path().join("demo").exists());
|
||||
}
|
||||
Reference in new issue
Block a user