From 8a178e311d4f7f6c9765301ad42b394b799fda7d Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Sat, 24 Dec 2016 13:44:24 +0000 Subject: [PATCH] fix test --- src/book/bookconfig_test.rs | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/book/bookconfig_test.rs b/src/book/bookconfig_test.rs index 298a3d7b..34122628 100644 --- a/src/book/bookconfig_test.rs +++ b/src/book/bookconfig_test.rs @@ -18,19 +18,12 @@ fn it_parses_json_config() { config.parse_from_json_string(&text.to_string()); - let expected = r#"BookConfig { - root: ".", - dest: "book", - src: "src", - theme_path: "theme", - title: "mdBook Documentation", - author: "Mathieu David", - description: "Create book from markdown files. Like Gitbook but implemented in Rust", - indent_spaces: 4, - multilingual: false -}"#; + let mut expected = BookConfig::new(Path::new(".")); + expected.title = "mdBook Documentation".to_string(); + expected.author = "Mathieu David".to_string(); + expected.description = "Create book from markdown files. Like Gitbook but implemented in Rust".to_string(); - assert_eq!(format!("{:#?}", config), expected); + assert_eq!(format!("{:#?}", config), format!("{:#?}", expected)); } #[test] @@ -46,19 +39,12 @@ author = "Mathieu David" config.parse_from_toml_string(&text.to_string()); - let expected = r#"BookConfig { - root: ".", - dest: "book", - src: "src", - theme_path: "theme", - title: "mdBook Documentation", - author: "Mathieu David", - description: "Create book from markdown files. Like Gitbook but implemented in Rust", - indent_spaces: 4, - multilingual: false -}"#; + let mut expected = BookConfig::new(Path::new(".")); + expected.title = "mdBook Documentation".to_string(); + expected.author = "Mathieu David".to_string(); + expected.description = "Create book from markdown files. Like Gitbook but implemented in Rust".to_string(); - assert_eq!(format!("{:#?}", config), expected); + assert_eq!(format!("{:#?}", config), format!("{:#?}", expected)); } #[test]