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 {
299
299
Err ( msg) => eprintln!( "Warning for license template file {:?}: {}" ,
300
300
lt_path, msg) ,
301
301
}
302
+ } else {
303
+ self . license_template = None ;
302
304
}
303
305
}
304
306
}
Original file line number Diff line number Diff line change @@ -491,6 +491,18 @@ mod test {
491
491
assert ! ( config. license_template. is_some( ) ) ;
492
492
}
493
493
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
+
494
506
#[ test]
495
507
fn test_dump_default_config ( ) {
496
508
let default_config = format ! (
You can’t perform that action at this time.
0 commit comments