Remove 'curly_quotes' key from the json config

This commit is contained in:
Mathieu David 2017-06-23 00:48:59 +02:00
parent d252dc82d6
commit 26fc980ffb
3 changed files with 7 additions and 31 deletions

View File

@ -160,12 +160,6 @@ impl BookConfig {
}
}
if let Some(curly_quotes) = jsonconfig.curly_quotes {
if let Some(htmlconfig) = self.get_mut_html_config() {
htmlconfig.set_curly_quotes(curly_quotes);
}
}
self
}

View File

@ -13,7 +13,6 @@ pub struct JsonConfig {
pub description: Option<String>,
pub theme_path: Option<PathBuf>,
pub curly_quotes: Option<bool>,
pub google_analytics: Option<String>,
}
@ -40,5 +39,3 @@ impl JsonConfig {
return Ok(config);
}
}

View File

@ -85,18 +85,3 @@ fn from_json_output_html_theme() {
assert_eq!(htmlconfig.get_theme().expect("the theme key was provided"), &PathBuf::from("root/theme"));
}
// Tests that the `curly_quotes` key is correctly parsed in the JSON config
#[test]
fn from_json_output_html_curly_quotes() {
let json = r#"{
"curly_quotes": true
}"#;
let parsed = JsonConfig::from_json(&json).expect("This should parse");
let config = BookConfig::from_jsonconfig("root", parsed);
let htmlconfig = config.get_html_config().expect("There should be an HtmlConfig");
assert_eq!(htmlconfig.get_curly_quotes(), true);
}