Skip to content

Commit 2a7a421

Browse files
epagedjc
authored andcommitted
test: Demonstrate show's behavior
1 parent a320264 commit 2a7a421

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

tests/suite/cli_rustup_ui.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::fs::create_dir_all;
22
use std::path::Path;
33

4+
use rustup::test::{CliTestContext, Scenario};
45
use snapbox::Data;
56
use snapbox::cmd::{Command, cargo_bin};
67

@@ -240,6 +241,26 @@ fn rustup_set_cmd_profile_cmd_help_flag() {
240241
);
241242
}
242243

244+
#[tokio::test]
245+
async fn rustup_show_toolchain() {
246+
let name = "rustup_show_toolchain";
247+
let cx = CliTestContext::new(Scenario::SimpleV2).await;
248+
cx.config
249+
.expect(["rustup", "default", "nightly"])
250+
.await
251+
.is_ok();
252+
cx.config
253+
.expect_with_env(["rustup", "show"], [("RUSTUP_TERM_COLOR", "always")])
254+
.await
255+
.extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())])
256+
.with_stdout(Data::read_from(
257+
Path::new(&format!("tests/suite/cli_rustup_ui/{name}.stdout.term.svg")),
258+
None,
259+
))
260+
.with_stderr("")
261+
.is_ok();
262+
}
263+
243264
#[test]
244265
fn rustup_show_cmd_help_flag() {
245266
test_help("rustup_show_cmd_help_flag", &["show", "--help"]);
Lines changed: 50 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)