2022-10-28 10:23:05 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2022-10-28 13:44:43 +00:00
|
|
|
use {color_eyre::Result, hooked_library::Config};
|
2022-10-28 10:23:05 +00:00
|
|
|
|
|
|
|
use {insta::assert_debug_snapshot, test_case::test_case};
|
|
|
|
|
|
|
|
#[test_case("defaults" ; "defaults")]
|
2022-10-28 12:06:03 +00:00
|
|
|
#[test_case("with-hooks" ; "with-hooks")]
|
2022-10-28 10:23:05 +00:00
|
|
|
fn test_config_parsing(file_name: &str) -> Result<()> {
|
|
|
|
let file = PathBuf::from(format!("tests/parsing/{file_name}.toml"));
|
|
|
|
let config = Config::from_toml_file(file)?;
|
|
|
|
assert_debug_snapshot!(format!("{file_name}"), config);
|
|
|
|
Ok(())
|
|
|
|
}
|