add test for project name
authorcsmoe <35686186+csmoe@users.noreply.github.com>
Tue, 1 May 2018 01:39:22 +0000 (09:39 +0800)
committercsmoe <35686186+csmoe@users.noreply.github.com>
Tue, 1 May 2018 01:39:22 +0000 (09:39 +0800)
tests/testsuite/new.rs

index e5522f72d4b2b2b0d56645d06a3bdc7fbfa1a295..1fab114bbb2af83074292c67efa20d892cd34971 100644 (file)
@@ -545,3 +545,18 @@ fn explicit_invalid_name_not_suggested() {
         ),
     );
 }
+
+#[test]
+fn explicit_project_name() {
+    assert_that(
+        cargo_process("new")
+            .arg("--lib")
+            .arg("foo")
+            .arg("--name")
+            .arg("bar")
+            .env("USER", "foo"),
+        execs()
+            .with_status(0)
+            .with_stderr("[CREATED] library `bar` project"),
+    );
+}