Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Jun 18, 2024
1 parent db0fc26 commit 5e2e033
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
11 changes: 7 additions & 4 deletions tests/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ fn fuelup_default_latest_and_custom() -> Result<()> {
#[test]
fn fuelup_default_uninstalled_toolchain() -> Result<()> {
testcfg::setup(FuelupState::LatestToolchainInstalled, &|cfg| {
let triple = TargetTriple::from_host().unwrap();
let output = cfg.fuelup(&["default", "nightly"]);
let expected_stdout = format!(
"Toolchain with name 'nightly-{}' does not exist\n",
TargetTriple::from_host().unwrap()
"Toolchain with name 'nightly-{}' does not exist\n\n\
\u{1b}[1mInstalled toolchains\u{1b}[0m\n\
--------------------\n\
latest-{}\n\n",
triple, triple
);

assert_eq!(output.stdout, expected_stdout);
})?;

Expand Down Expand Up @@ -128,7 +131,7 @@ fn fuelup_default_missing_toolchain() -> Result<()> {
let output = cfg.fuelup(&["default", "abcd"]);
let expected_stdout = format!(
"Toolchain with name 'abcd' does not exist\n\n\
\u{1b}[1minstalled toolchains\u{1b}[0m\n\
\u{1b}[1mInstalled toolchains\u{1b}[0m\n\
--------------------\n\
latest-{triple}\n\
nightly-{triple}\n\
Expand Down
14 changes: 7 additions & 7 deletions tests/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn fuelup_show_latest() -> Result<()> {
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
latest-{target} (default)
nightly-{target}
Expand Down Expand Up @@ -66,7 +66,7 @@ fn fuelup_show_and_switch() -> Result<()> {
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
latest-{target} (default)
nightly-{target}
Expand Down Expand Up @@ -102,7 +102,7 @@ latest-{target} (default)
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
latest-{target}
nightly-{target} (default)
Expand Down Expand Up @@ -146,7 +146,7 @@ fn fuelup_show_custom() -> Result<()> {
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
my_toolchain (default)
Expand Down Expand Up @@ -187,7 +187,7 @@ fn fuelup_show_override() -> Result<()> {
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
latest-{target} (default)
Expand Down Expand Up @@ -229,7 +229,7 @@ fn fuelup_show_latest_then_override() -> Result<()> {
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
latest-{target} (default)
nightly-{target}
Expand Down Expand Up @@ -278,7 +278,7 @@ latest-{target} (default)
r#"Default host: {target}
fuelup home: {fuelup_home_str}
installed toolchains
Installed toolchains
--------------------
latest-{target} (default)
nightly-{target}
Expand Down

0 comments on commit 5e2e033

Please sign in to comment.