fix test
This commit is contained in:
parent
53ec61ac70
commit
8a178e311d
|
@ -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]
|
||||||
|
|
Loading…
Reference in New Issue