File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,26 @@ fn base_mdbook_init_can_skip_confirmation_prompts() {
22
22
23
23
assert ! ( !temp. path( ) . join( ".gitignore" ) . exists( ) ) ;
24
24
}
25
+
26
+ /// Run `mdbook init` with `--title` without git config.
27
+ ///
28
+ /// Regression test for https://github.com/rust-lang/mdBook/issues/2485
29
+ #[ test]
30
+ fn no_git_config_with_title ( ) {
31
+ let temp = DummyBook :: new ( ) . build ( ) . unwrap ( ) ;
32
+
33
+ // doesn't exist before
34
+ assert ! ( !temp. path( ) . join( "book" ) . exists( ) ) ;
35
+
36
+ let mut cmd = mdbook_cmd ( ) ;
37
+ cmd. args ( [ "init" , "--title" , "Example title" ] )
38
+ . current_dir ( temp. path ( ) )
39
+ . env ( "GIT_CONFIG_GLOBAL" , "" )
40
+ . env ( "GIT_CONFIG_NOSYSTEM" , "1" ) ;
41
+ cmd. assert ( )
42
+ . success ( )
43
+ . stdout ( predicates:: str:: contains ( "\n All done, no errors...\n " ) ) ;
44
+
45
+ let config = Config :: from_disk ( temp. path ( ) . join ( "book.toml" ) ) . unwrap ( ) ;
46
+ assert_eq ! ( config. book. title, None ) ;
47
+ }
You can’t perform that action at this time.
0 commit comments