Skip to content

Commit e0477a3

Browse files
committed
test(remove): Show what happens with last dep in a table
1 parent c4a9e45 commit e0477a3

File tree

6 files changed

+80
-0
lines changed

6 files changed

+80
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "cargo-remove-test-fixture"
3+
version = "0.1.0"
4+
edition = "2015"
5+
6+
[[bin]]
7+
name = "main"
8+
path = "src/main.rs"
9+
10+
[dependencies]
11+
docopt = "0.6"
12+
13+
[features]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
use cargo_test_support::compare::assert_ui;
2+
use cargo_test_support::current_dir;
3+
use cargo_test_support::file;
4+
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
6+
use cargo_test_support::CargoCommandExt;
7+
use cargo_test_support::Project;
8+
9+
#[cargo_test]
10+
fn case() {
11+
cargo_test_support::registry::init();
12+
cargo_test_support::registry::Package::new("docopt", "0.6.2+my-package").publish();
13+
14+
let project = Project::from_template(current_dir!().join("in"));
15+
let project_root = project.root();
16+
let cwd = &project_root;
17+
18+
snapbox::cmd::Command::cargo_ui()
19+
.arg("remove")
20+
.args(["docopt"])
21+
.current_dir(cwd)
22+
.assert()
23+
.success()
24+
.stdout_eq(str![""])
25+
.stderr_eq(file!["stderr.term.svg"]);
26+
27+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
28+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "cargo-remove-test-fixture"
3+
version = "0.1.0"
4+
edition = "2015"
5+
6+
[[bin]]
7+
name = "main"
8+
path = "src/main.rs"
9+
10+
[features]
Lines changed: 27 additions & 0 deletions
Loading

tests/testsuite/cargo_remove/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ mod invalid_section;
1515
mod invalid_section_dep;
1616
mod invalid_target;
1717
mod invalid_target_dep;
18+
mod last_dep;
1819
mod multiple_deps;
1920
mod multiple_dev;
2021
mod no_arg;

0 commit comments

Comments
 (0)