rustic/tests/config.rs
simonsan a642f134ed
test: refactor integration tests to assert_cmd and predicates, test all configs in config subdirectory (#1060)
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>
2024-02-29 20:04:19 +00:00

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(())
}