Skip to content

Commit

Permalink
Use snapbox assertion instead of old Project::cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed May 3, 2022
1 parent b3af6d8 commit aff8e81
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/testsuite/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ fn simple_lib() {
assert().subset_matches("tests/snapshots/init/simple_lib.out", project_root);
assert!(!project_root.join(".gitignore").is_file());

project.cargo("build").run();
snapbox::cmd::Command::cargo()
.current_dir(project_root)
.arg("build")
.assert()
.success();
assert!(!project.bin("foo").is_file());
}

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

project.cargo("build").run();
snapbox::cmd::Command::cargo()
.current_dir(project_root)
.arg("build")
.assert()
.success();
assert!(project.bin("case").is_file());
}

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

project.cargo("build").run();
snapbox::cmd::Command::cargo()
.current_dir(project_root)
.arg("build")
.assert()
.success();
}

#[cargo_test]
Expand Down

0 comments on commit aff8e81

Please sign in to comment.