Skip to content

Commit aff8e81

Browse files
committed
Use snapbox assertion instead of old Project::cargo
1 parent b3af6d8 commit aff8e81

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tests/testsuite/init.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ fn simple_lib() {
3434
assert().subset_matches("tests/snapshots/init/simple_lib.out", project_root);
3535
assert!(!project_root.join(".gitignore").is_file());
3636

37-
project.cargo("build").run();
37+
snapbox::cmd::Command::cargo()
38+
.current_dir(project_root)
39+
.arg("build")
40+
.assert()
41+
.success();
3842
assert!(!project.bin("foo").is_file());
3943
}
4044

@@ -54,7 +58,11 @@ fn simple_bin() {
5458
assert().subset_matches("tests/snapshots/init/simple_bin.out", project_root);
5559
assert!(!project_root.join(".gitignore").is_file());
5660

57-
project.cargo("build").run();
61+
snapbox::cmd::Command::cargo()
62+
.current_dir(project_root)
63+
.arg("build")
64+
.assert()
65+
.success();
5866
assert!(project.bin("case").is_file());
5967
}
6068

@@ -77,7 +85,11 @@ fn simple_git_ignore_exists() {
7785
);
7886
assert!(project_root.join(".git").is_dir());
7987

80-
project.cargo("build").run();
88+
snapbox::cmd::Command::cargo()
89+
.current_dir(project_root)
90+
.arg("build")
91+
.assert()
92+
.success();
8193
}
8294

8395
#[cargo_test]

0 commit comments

Comments
 (0)