File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -263,11 +263,6 @@ impl MDBook {
263263 }
264264 }
265265
266- // Index Preprocessor is disabled so that chapter paths
267- // continue to point to the actual markdown files.
268- self . preprocessors = determine_preprocessors ( & self . config , & self . root ) ?;
269- self . preprocessors
270- . shift_remove_entry ( IndexPreprocessor :: NAME ) ;
271266 let ( book, _) = self . preprocess_book ( & TestRenderer ) ?;
272267
273268 let color_output = std:: io:: stderr ( ) . is_terminal ( ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,20 @@ fn runs_preprocessors() {
4444 assert_eq ! ( inner. rendered_with, [ "html" ] ) ;
4545}
4646
47+ // Run tests with a custom preprocessor.
48+ #[ test]
49+ fn test_with_custom_preprocessor ( ) {
50+ let test = BookTest :: init ( |_| { } ) ;
51+ let spy: Arc < Mutex < Inner > > = Default :: default ( ) ;
52+ let mut book = test. load_book ( ) ;
53+ book. with_preprocessor ( Spy ( Arc :: clone ( & spy) ) ) ;
54+ book. test ( vec ! [ ] ) . unwrap ( ) ;
55+
56+ let inner = spy. lock ( ) . unwrap ( ) ;
57+ assert_eq ! ( inner. run_count, 1 ) ;
58+ assert_eq ! ( inner. rendered_with, [ "test" ] ) ;
59+ }
60+
4761// No-op preprocessor works.
4862#[ test]
4963fn nop_preprocessor ( ) {
You can’t perform that action at this time.
0 commit comments