mirror of https://github.com/chipsenkbeil/distant
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
Rust
35 lines
1.0 KiB
Rust
2 years ago
|
use crate::cli::fixtures::*;
|
||
3 years ago
|
use rstest::*;
|
||
|
use std::env;
|
||
|
|
||
|
#[rstest]
|
||
2 years ago
|
#[test_log::test]
|
||
1 year ago
|
fn should_output_system_info(ctx: DistantManagerCtx) {
|
||
|
ctx.cmd("system-info")
|
||
3 years ago
|
.assert()
|
||
|
.success()
|
||
|
.stdout(format!(
|
||
|
concat!(
|
||
|
"Family: {:?}\n",
|
||
|
"Operating System: {:?}\n",
|
||
|
"Arch: {:?}\n",
|
||
|
"Cwd: {:?}\n",
|
||
|
"Path Sep: {:?}\n",
|
||
2 years ago
|
"Username: {:?}\n",
|
||
1 year ago
|
"Shell: {:?}",
|
||
3 years ago
|
),
|
||
|
env::consts::FAMILY.to_string(),
|
||
|
env::consts::OS.to_string(),
|
||
|
env::consts::ARCH.to_string(),
|
||
|
env::current_dir().unwrap_or_default(),
|
||
|
std::path::MAIN_SEPARATOR,
|
||
2 years ago
|
whoami::username(),
|
||
|
if cfg!(windows) {
|
||
|
std::env::var("ComSpec").unwrap_or_else(|_| String::from("cmd.exe"))
|
||
|
} else {
|
||
|
std::env::var("SHELL").unwrap_or_else(|_| String::from("/bin/sh"))
|
||
|
}
|
||
3 years ago
|
))
|
||
|
.stderr("");
|
||
|
}
|