This commit is contained in:
Gambhiro 2016-12-24 13:44:24 +00:00
parent 53ec61ac70
commit 8a178e311d
1 changed files with 10 additions and 24 deletions

View File

@ -18,19 +18,12 @@ fn it_parses_json_config() {
config.parse_from_json_string(&text.to_string()); config.parse_from_json_string(&text.to_string());
let expected = r#"BookConfig { let mut expected = BookConfig::new(Path::new("."));
root: ".", expected.title = "mdBook Documentation".to_string();
dest: "book", expected.author = "Mathieu David".to_string();
src: "src", expected.description = "Create book from markdown files. Like Gitbook but implemented in Rust".to_string();
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
}"#;
assert_eq!(format!("{:#?}", config), expected); assert_eq!(format!("{:#?}", config), format!("{:#?}", expected));
} }
#[test] #[test]
@ -46,19 +39,12 @@ author = "Mathieu David"
config.parse_from_toml_string(&text.to_string()); config.parse_from_toml_string(&text.to_string());
let expected = r#"BookConfig { let mut expected = BookConfig::new(Path::new("."));
root: ".", expected.title = "mdBook Documentation".to_string();
dest: "book", expected.author = "Mathieu David".to_string();
src: "src", expected.description = "Create book from markdown files. Like Gitbook but implemented in Rust".to_string();
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
}"#;
assert_eq!(format!("{:#?}", config), expected); assert_eq!(format!("{:#?}", config), format!("{:#?}", expected));
} }
#[test] #[test]