#[path = "../src/test_helpers.rs"]
mod test_helpers;
use crate::test_helpers::bin_path;
use std::process::Command;
#[test]
#[cfg_attr(feature = "offline_tests", ignore)]
fn no_rustup_installed_toolchain() {
let cargo_cache = Command::new(bin_path())
.arg("toolchain")
.env("RUSTUP_HOME", "/tmp/this/dir/does/not/exist")
.output();
assert!(cargo_cache.is_ok(), "cargo cache toolchain failed to run");
let cc_output = &cargo_cache.unwrap();
let cc_stdout = String::from_utf8_lossy(&cc_output.stdout).into_owned();
let cc_stderr = String::from_utf8_lossy(&cc_output.stderr).into_owned();
assert_eq!(cc_stdout, "");
assert_eq!(
cc_stderr,
"Could not find any toolchains installed via rustup!\n"
);
}