File tree Expand file tree Collapse file tree 4 files changed +14
-18
lines changed Expand file tree Collapse file tree 4 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -270,24 +270,6 @@ fn example_book_can_build() {
270270 md. build ( ) . unwrap ( ) ;
271271}
272272
273- #[ test]
274- fn theme_dir_overrides_work_correctly ( ) {
275- let book_dir = dummy_book:: new_copy_of_example_book ( ) . unwrap ( ) ;
276- let book_dir = book_dir. path ( ) ;
277- let theme_dir = book_dir. join ( "theme" ) ;
278-
279- let mut index = mdbook:: theme:: INDEX . to_vec ( ) ;
280- index. extend_from_slice ( b"\n <!-- This is a modified index.hbs! -->" ) ;
281-
282- write_file ( & theme_dir, "index.hbs" , & index) . unwrap ( ) ;
283-
284- let md = MDBook :: load ( book_dir) . unwrap ( ) ;
285- md. build ( ) . unwrap ( ) ;
286-
287- let built_index = book_dir. join ( "book" ) . join ( "index.html" ) ;
288- dummy_book:: assert_contains_strings ( built_index, & [ "This is a modified index.hbs!" ] ) ;
289- }
290-
291273/// Checks formatting of summary names with inline elements.
292274#[ test]
293275fn summary_with_markdown_formatting ( ) {
Original file line number Diff line number Diff line change @@ -30,3 +30,15 @@ fn empty_theme() {
3030"# ] ] ) ;
3131 } ) ;
3232}
33+
34+ // Checks overriding index.hbs.
35+ #[ test]
36+ fn override_index ( ) {
37+ BookTest :: from_dir ( "theme/override_index" ) . check_file (
38+ "book/index.html" ,
39+ str![ [ r#"
40+ This is a modified index.hbs!
41+
42+ "# ] ] ,
43+ ) ;
44+ }
Original file line number Diff line number Diff line change 1+ - [ Intro] ( index.md )
Original file line number Diff line number Diff line change 1+ This is a modified index.hbs!
You can’t perform that action at this time.
0 commit comments