-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the indoc crate to help clean up examples (#639)
* add Cargo.lock * use indoc for tests
- Loading branch information
1 parent
2d81994
commit acee544
Showing
8 changed files
with
266 additions
and
255 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use anyhow::Result; | ||
use fuelup::{fmt::format_toolchain_with_target, target_triple::TargetTriple}; | ||
|
||
use indoc::formatdoc; | ||
pub mod testcfg; | ||
use testcfg::{FuelupState, ALL_BINS, DATE}; | ||
|
||
|
@@ -49,12 +49,12 @@ fn fuelup_component_add_disallowed() -> Result<()> { | |
|
||
testcfg::setup(FuelupState::LatestToolchainInstalled, &|cfg| { | ||
let output = cfg.fuelup(&["component", "add", "[email protected]"]); | ||
let expected_stdout = format!( | ||
let expected_stdout = formatdoc!( | ||
r#"Installing specific components is reserved for custom toolchains. | ||
You are currently using '{latest}'. | ||
You are currently using '{latest}'. | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
); | ||
assert_eq!(output.stdout, expected_stdout); | ||
|
||
|
@@ -64,12 +64,12 @@ You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | |
|
||
testcfg::setup(FuelupState::NightlyInstalled, &|cfg| { | ||
let output = cfg.fuelup(&["component", "add", "[email protected]"]); | ||
let expected_stdout = format!( | ||
let expected_stdout = formatdoc!( | ||
r#"Installing specific components is reserved for custom toolchains. | ||
You are currently using '{nightly}'. | ||
You are currently using '{nightly}'. | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
); | ||
assert_eq!(output.stdout, expected_stdout); | ||
|
||
|
@@ -79,12 +79,12 @@ You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | |
|
||
testcfg::setup(FuelupState::NightlyDateInstalled, &|cfg| { | ||
let output = cfg.fuelup(&["component", "add", "[email protected]"]); | ||
let expected_stdout = format!( | ||
let expected_stdout = formatdoc!( | ||
r#"Installing specific components is reserved for custom toolchains. | ||
You are currently using '{nightly_date}'. | ||
You are currently using '{nightly_date}'. | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
); | ||
assert_eq!(output.stdout, expected_stdout); | ||
|
||
|
@@ -104,13 +104,12 @@ fn fuelup_component_remove_disallowed() -> Result<()> { | |
|
||
expect_files_exist(&latest_toolchain_bin_dir, ALL_BINS); | ||
let output = cfg.fuelup(&["component", "remove", "forc"]); | ||
|
||
let expected_stdout = format!( | ||
let expected_stdout = formatdoc!( | ||
r#"Removing specific components is reserved for custom toolchains. | ||
You are currently using '{latest}'. | ||
You are currently using '{latest}'. | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"#, | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
); | ||
assert_eq!(output.stdout, expected_stdout); | ||
expect_files_exist(&latest_toolchain_bin_dir, ALL_BINS); | ||
|
@@ -121,13 +120,12 @@ You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | |
|
||
expect_files_exist(&latest_toolchain_bin_dir, ALL_BINS); | ||
let output = cfg.fuelup(&["component", "remove", "forc"]); | ||
|
||
let expected_stdout = format!( | ||
let expected_stdout = formatdoc!( | ||
r#"Removing specific components is reserved for custom toolchains. | ||
You are currently using '{nightly_date}'. | ||
You are currently using '{nightly_date}'. | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
You may create a custom toolchain using 'fuelup toolchain new <toolchain>'. | ||
"# | ||
); | ||
assert_eq!(output.stdout, expected_stdout); | ||
expect_files_exist(&latest_toolchain_bin_dir, ALL_BINS); | ||
|
Oops, something went wrong.