Skip to content

Commit 1e0dca3

Browse files
committed
test: migrate testsuite verify_project to snapbox
1 parent d602434 commit 1e0dca3

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

tests/testsuite/verify_project.rs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
//! Tests for the `cargo verify-project` command.
22
3-
#![allow(deprecated)]
4-
5-
use cargo_test_support::{basic_bin_manifest, main_file, project};
6-
7-
fn verify_project_success_output() -> String {
8-
r#"{"success":"true"}"#.into()
9-
}
3+
use cargo_test_support::{basic_bin_manifest, main_file, project, str};
104

115
#[cargo_test]
126
fn cargo_verify_project_path_to_cargo_toml_relative() {
@@ -17,7 +11,10 @@ fn cargo_verify_project_path_to_cargo_toml_relative() {
1711

1812
p.cargo("verify-project --manifest-path foo/Cargo.toml")
1913
.cwd(p.root().parent().unwrap())
20-
.with_stdout(verify_project_success_output())
14+
.with_stdout_data(str![[r#"
15+
{"success":"true"}
16+
17+
"#]])
2118
.run();
2219
}
2320

@@ -31,7 +28,10 @@ fn cargo_verify_project_path_to_cargo_toml_absolute() {
3128
p.cargo("verify-project --manifest-path")
3229
.arg(p.root().join("Cargo.toml"))
3330
.cwd(p.root().parent().unwrap())
34-
.with_stdout(verify_project_success_output())
31+
.with_stdout_data(str![[r#"
32+
{"success":"true"}
33+
34+
"#]])
3535
.run();
3636
}
3737

@@ -43,7 +43,10 @@ fn cargo_verify_project_cwd() {
4343
.build();
4444

4545
p.cargo("verify-project")
46-
.with_stdout(verify_project_success_output())
46+
.with_stdout_data(str![[r#"
47+
{"success":"true"}
48+
49+
"#]])
4750
.run();
4851
}
4952

@@ -65,11 +68,17 @@ fn cargo_verify_project_honours_unstable_features() {
6568

6669
p.cargo("verify-project")
6770
.masquerade_as_nightly_cargo(&["test-dummy-unstable"])
68-
.with_stdout(verify_project_success_output())
71+
.with_stdout_data(str![[r#"
72+
{"success":"true"}
73+
74+
"#]])
6975
.run();
7076

7177
p.cargo("verify-project")
7278
.with_status(1)
73-
.with_json(r#"{"invalid":"failed to parse manifest at `[CWD]/Cargo.toml`"}"#)
79+
.with_stdout_data(str![[r#"
80+
{"invalid":"failed to parse manifest at `[..]`"}
81+
82+
"#]])
7483
.run();
7584
}

0 commit comments

Comments
 (0)