From c1e23d6c480aa07a5d2242c2ef35b26e502d5ae5 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 2 Oct 2024 16:46:42 +0200 Subject: [PATCH] tests: rust-toolchain + profile in settings --- tests/suite/cli_rustup.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 3fcf9760e7..dac4e02d06 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -2266,6 +2266,35 @@ channel = "nightly" .await; } +#[tokio::test] +async fn default_profile_is_respected_with_rust_toolchain_file() { + let mut cx = CliTestContext::new(Scenario::SimpleV2).await; + cx.config + .expect_ok(&["rustup", "set", "profile", "minimal"]) + .await; + cx.config.expect_ok(&["rustup", "default", "stable"]).await; + + let cwd = cx.config.current_dir(); + let toolchain_file = cwd.join("rust-toolchain"); + raw::write_file( + &toolchain_file, + r#" +[toolchain] +channel = "nightly" +"#, + ) + .unwrap(); + cx.config + .expect_ok(&["rustup", "toolchain", "install"]) + .await; + cx.config + .expect_not_stdout_ok( + &["rustup", "component", "list"], + for_host!("rust-docs-{} (installed)"), + ) + .await; +} + #[tokio::test] async fn close_file_override_beats_far_directory_override() { let mut cx = CliTestContext::new(Scenario::SimpleV2).await;