#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, trivial_casts, unused_lifetimes)]
use abscissa_core::testing::prelude::*;
use once_cell::sync::Lazy;
pub static RUNNER: Lazy<CmdRunner> = Lazy::new(CmdRunner::default);
#[test]
fn start_no_args() {
let mut runner = RUNNER.clone();
let mut cmd = runner.capture_stdout().run();
cmd.stdout().expect_regex(
format!(
"^[^ ]*{} {}",
env!("CARGO_PKG_NAME"),
regex::escape(env!("CARGO_PKG_VERSION"))
)
.as_str(),
); cmd.wait().unwrap().expect_success();
}
#[test]
fn example_configuration_is_valid() {
let mut runner = RUNNER.clone();
let mut cmd = runner
.capture_stdout()
.args(["--config", "../../config.toml", "config", "validate"])
.run();
cmd.stdout().expect_regex("configuration is valid");
cmd.wait().unwrap().expect_success();
}