mod common;
use common::Fixture;
fn stdout(cmd_args: &[&str]) -> String {
let fx = Fixture::new();
let output = fx
.cmd()
.env_remove("MODDE_DATA_DIR")
.args(cmd_args)
.output()
.expect("spawn modde");
let mut combined = String::from_utf8_lossy(&output.stdout).into_owned();
let stderr = String::from_utf8_lossy(&output.stderr);
if !stderr.is_empty() {
combined.push_str("\n--- stderr ---\n");
combined.push_str(&stderr);
}
combined
}
#[test]
fn snapshot_top_level_help() {
insta::assert_snapshot!(stdout(&["--help"]));
}
#[test]
fn snapshot_install_help() {
insta::assert_snapshot!(stdout(&["install", "--help"]));
}
#[test]
fn snapshot_profile_help() {
insta::assert_snapshot!(stdout(&["profile", "--help"]));
}
#[test]
fn snapshot_game_help() {
insta::assert_snapshot!(stdout(&["game", "--help"]));
}
#[test]
fn snapshot_game_add_help() {
insta::assert_snapshot!(stdout(&["game", "add", "--help"]));
}
#[test]
fn snapshot_game_export_help() {
insta::assert_snapshot!(stdout(&["game", "export", "--help"]));
}
#[test]
fn snapshot_game_import_help() {
insta::assert_snapshot!(stdout(&["game", "import", "--help"]));
}
#[test]
fn snapshot_game_import_profile_help() {
insta::assert_snapshot!(stdout(&["game", "import-profile", "--help"]));
}
#[test]
fn snapshot_nxm_help() {
insta::assert_snapshot!(stdout(&["nxm", "--help"]));
}
#[test]
fn snapshot_no_args_error() {
insta::assert_snapshot!(stdout(&[]));
}
#[test]
fn snapshot_unknown_subcommand_error() {
insta::assert_snapshot!(stdout(&["nonexistent"]));
}