Fix more tests by updating error messages
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 8 Mar 2018 19:40:28 +0000 (22:40 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 8 Mar 2018 20:31:56 +0000 (23:31 +0300)
tests/testsuite/new.rs
tests/testsuite/run.rs

index 819205ee04205bea5004ceb718a5a29262b683bf..ab30b20624587257261f0b507b5688b86a3c2a31 100644 (file)
@@ -100,16 +100,17 @@ fn simple_git() {
 }
 
 #[test]
-#[ignore]
 fn no_argument() {
     assert_that(cargo_process("new"),
                 execs().with_status(1)
                        .with_stderr("\
-[ERROR] Invalid arguments.
+error: The following required arguments were not provided:
+    <path>
 
-Usage:
-    cargo new [options] <path>
-    cargo new -h | --help
+USAGE:
+    cargo new [OPTIONS] <path>
+
+For more information try --help
 "));
 }
 
@@ -371,16 +372,16 @@ fn subpackage_git_with_vcs_arg() {
 }
 
 #[test]
-#[ignore]
 fn unknown_flags() {
     assert_that(cargo_process("new").arg("foo").arg("--flag"),
                 execs().with_status(1)
                        .with_stderr("\
-[ERROR] Unknown flag: '--flag'
+error: Found argument '--flag' which wasn't expected, or isn't valid in this context
+
+USAGE:
+    cargo new [OPTIONS] <path>
 
-Usage:
-    cargo new [..]
-    cargo new [..]
+For more information try --help
 "));
 }
 
index 6717b57034d53fc362dd0fe3f5d9860a0006ed49..0d123d05afd643ae8f8842626397a294c190facb 100644 (file)
@@ -285,7 +285,6 @@ example
 }
 
 #[test]
-#[ignore]
 fn run_bins() {
     let p = project("foo")
         .file("Cargo.toml", r#"
@@ -306,7 +305,7 @@ fn run_bins() {
     assert_that(p.cargo("run").arg("--bins"),
                 execs().with_status(1)
                        .with_stderr_contains("\
-[ERROR] Unknown flag: '--bins'. Did you mean '--bin'?"));
+error: Found argument '--bins' which wasn't expected, or isn't valid in this context"));
 }
 
 #[test]