vmexec 0.7.0

Run a single command in a speedy virtual machine with zero-setup
Documentation
use assert_cmd::cargo::cargo_bin_cmd;
use clap::{ValueEnum, crate_name, crate_version};
use clap_complete::Shell;
use color_eyre::Result;

#[test]
/// Show help and exit.
fn help_shows() -> Result<()> {
    cargo_bin_cmd!().arg("-h").assert().success();

    Ok(())
}

#[test]
/// Show version and exit.
fn version_shows() -> Result<()> {
    cargo_bin_cmd!()
        .arg("-V")
        .assert()
        .success()
        .stdout(format!("{} {}\n", crate_name!(), crate_version!()));

    Ok(())
}

#[test]
/// Print completions and exit.
fn print_completions() -> Result<()> {
    for shell in Shell::value_variants() {
        cargo_bin_cmd!()
            .arg("completions")
            .arg(shell.to_string())
            .assert()
            .success();
    }

    Ok(())
}

#[test]
/// Print completions rejects invalid shells.
fn print_completions_invalid_shell() -> Result<()> {
    cargo_bin_cmd!()
        .arg("completions")
        .arg("fakeshell")
        .assert()
        .failure();

    Ok(())
}