mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
The intention of this PR is to make it easier (more straight forward) to write `rustic` integration tests by utilizing the `assert_cmd` and `predicates` crates. --------- Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
18 lines
428 B
Rust
18 lines
428 B
Rust
//! Configuration file tests
|
|
|
|
use anyhow::Result;
|
|
use rstest::*;
|
|
use rustic_rs::RusticConfig;
|
|
use std::{fs, path::PathBuf};
|
|
|
|
/// Ensure all `configs` parse as a valid config files
|
|
#[rstest]
|
|
fn test_parse_rustic_configs_is_ok(
|
|
#[files("config/**/*.toml")] config_path: PathBuf,
|
|
) -> Result<()> {
|
|
let toml_string = fs::read_to_string(config_path)?;
|
|
let _ = toml::from_str::<RusticConfig>(&toml_string)?;
|
|
|
|
Ok(())
|
|
}
|