]>
Commit | Line | Data |
---|---|---|
cbd4edb2 | 1 | use cargo_test_support::compare::assert_ui; |
92fbc4e3 SS |
2 | use cargo_test_support::prelude::*; |
3 | use cargo_test_support::Project; | |
4 | ||
5 | use crate::cargo_add::init_registry; | |
6 | use cargo_test_support::curr_dir; | |
7 | ||
8 | #[cargo_test] | |
9 | fn detect_workspace_inherit_optional() { | |
10 | init_registry(); | |
11 | let project = Project::from_template(curr_dir!().join("in")); | |
12 | let project_root = project.root(); | |
13 | let cwd = &project_root; | |
14 | ||
cbd4edb2 | 15 | snapbox::cmd::Command::cargo_ui() |
92fbc4e3 SS |
16 | .arg("add") |
17 | .args(["foo", "-p", "bar", "--optional"]) | |
18 | .current_dir(cwd) | |
19 | .assert() | |
20 | .success() | |
21 | .stdout_matches_path(curr_dir!().join("stdout.log")) | |
22 | .stderr_matches_path(curr_dir!().join("stderr.log")); | |
23 | ||
cbd4edb2 | 24 | assert_ui().subset_matches(curr_dir!().join("out"), &project_root); |
92fbc4e3 | 25 | } |