From 98662dd899d4eaab5dc2da07d5bb658960b588a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kot?= Date: Sat, 24 Apr 2021 19:44:27 +0200 Subject: Modify tests to use both ConfigBuilder and Config --- tests/file_yaml.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests/file_yaml.rs') diff --git a/tests/file_yaml.rs b/tests/file_yaml.rs index b2746cd..645829a 100644 --- a/tests/file_yaml.rs +++ b/tests/file_yaml.rs @@ -35,11 +35,9 @@ struct Settings { } fn make() -> Config { - let mut c = Config::default(); - c.merge(File::new("tests/Settings", FileFormat::Yaml)) - .unwrap(); - - c + let mut c = Config::builder(); + c.add_source(File::new("tests/Settings", FileFormat::Yaml)); + c.build().unwrap() } #[test] @@ -68,8 +66,9 @@ fn test_file() { #[test] fn test_error_parse() { - let mut c = Config::default(); - let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Yaml)); + let mut c = Config::builder(); + c.add_source(File::new("tests/Settings-invalid", FileFormat::Yaml)); + let res = c.build(); let path_with_extension: PathBuf = ["tests", "Settings-invalid.yaml"].iter().collect(); -- cgit v1.2.3