@@ -22,6 +22,7 @@ pub struct ConfigFile {
2222 pub cors : Option < CorsConfig > ,
2323 pub compression : Option < CompressionConfig > ,
2424 pub basic_auth : Option < BasicAuthConfig > ,
25+ pub logger : Option < bool > ,
2526}
2627
2728impl ConfigFile {
@@ -82,11 +83,12 @@ mod tests {
8283
8384 root_dir. push ( "./fixtures" ) ;
8485
86+ assert ! ( config. logger. is_none( ) ) ;
87+ assert ! ( config. compression. is_none( ) ) ;
8588 assert_eq ! ( config. host, host) ;
8689 assert_eq ! ( config. port, port) ;
8790 assert_eq ! ( config. verbose, Some ( true ) ) ;
8891 assert_eq ! ( config. root_dir, Some ( root_dir) ) ;
89- assert_eq ! ( config. compression, None ) ;
9092 }
9193
9294 #[ test]
@@ -279,4 +281,16 @@ mod tests {
279281 assert_eq ! ( basic_auth. username, String :: from( "johnappleseed" ) ) ;
280282 assert_eq ! ( basic_auth. password, String :: from( "john::likes::apples!" ) ) ;
281283 }
284+
285+ #[ test]
286+ fn parses_config_with_logger ( ) {
287+ let file_contents = r#"
288+ host = "0.0.0.0"
289+ port = 7878
290+ logger = true
291+ "# ;
292+ let config = ConfigFile :: parse_toml ( file_contents) . unwrap ( ) ;
293+
294+ assert_eq ! ( config. logger, Some ( true ) ) ;
295+ }
282296}
0 commit comments