File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,8 @@ macro_rules! create_config {
299299 Err ( msg) => eprintln!( "Warning for license template file {:?}: {}" ,
300300 lt_path, msg) ,
301301 }
302+ } else {
303+ self . license_template = None ;
302304 }
303305 }
304306 }
Original file line number Diff line number Diff line change @@ -491,6 +491,18 @@ mod test {
491491 assert ! ( config. license_template. is_some( ) ) ;
492492 }
493493
494+ #[ test]
495+ fn test_override_existing_license_with_no_license ( ) {
496+ if !crate :: is_nightly_channel!( ) {
497+ return ;
498+ }
499+ let toml = r#"license_template_path = "tests/license-template/lt.txt""# ;
500+ let mut config = Config :: from_toml ( toml, Path :: new ( "" ) ) . unwrap ( ) ;
501+ assert ! ( config. license_template. is_some( ) ) ;
502+ config. override_value ( "license_template_path" , "" ) ;
503+ assert ! ( config. license_template. is_none( ) ) ;
504+ }
505+
494506 #[ test]
495507 fn test_dump_default_config ( ) {
496508 let default_config = format ! (
You can’t perform that action at this time.
0 commit comments