Skip to content

Commit 154412a

Browse files
committed
Add tests 'rustup doc --toolchain'
1 parent 21e7f7d commit 154412a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/cli-rustup.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,14 +1424,23 @@ fn file_override_with_target_info() {
14241424
fn docs_with_path() {
14251425
setup(&|config| {
14261426
expect_ok(config, &["rustup", "default", "stable"]);
1427+
expect_ok(config, &["rustup", "toolchain", "install", "nightly"]);
14271428

14281429
let mut cmd = clitools::cmd(config, "rustup", &["doc", "--path"]);
14291430
clitools::env(config, &mut cmd);
1431+
14301432
let out = cmd.output().unwrap();
1433+
let path = format!("share{0}doc{0}rust{0}html", MAIN_SEPARATOR);
1434+
assert!(String::from_utf8(out.stdout).unwrap().contains(&path));
14311435

1432-
let stdout = String::from_utf8(out.stdout).unwrap();
1433-
let path = format!("share{}doc{}rust{}html",
1434-
MAIN_SEPARATOR, MAIN_SEPARATOR, MAIN_SEPARATOR);
1435-
assert!(stdout.contains(path.as_str()));
1436+
let mut cmd = clitools::cmd(
1437+
config,
1438+
"rustup",
1439+
&["doc", "--path", "--toolchain", "nightly"],
1440+
);
1441+
clitools::env(config, &mut cmd);
1442+
1443+
let out = cmd.output().unwrap();
1444+
assert!(String::from_utf8(out.stdout).unwrap().contains("nightly"));
14361445
});
14371446
}

0 commit comments

Comments
 (0)