diff --git a/tests/custom_preprocessors.rs b/tests/custom_preprocessors.rs index c32e94d3..49e934f1 100644 --- a/tests/custom_preprocessors.rs +++ b/tests/custom_preprocessors.rs @@ -56,13 +56,3 @@ fn ask_the_preprocessor_to_blow_up() { ) ); } - -#[test] -fn process_the_dummy_book() { - let dummy_book = DummyBook::new(); - let temp = dummy_book.build().unwrap(); - let mut md = MDBook::load(temp.path()).unwrap(); - md.with_preprocessor(example()); - - md.build().unwrap(); -} diff --git a/tests/testsuite/preprocessor.rs b/tests/testsuite/preprocessor.rs index 8c8793a6..8b87926b 100644 --- a/tests/testsuite/preprocessor.rs +++ b/tests/testsuite/preprocessor.rs @@ -40,3 +40,15 @@ fn runs_preprocessors() { assert_eq!(inner.run_count, 1); assert_eq!(inner.rendered_with, ["html"]); } + +// No-op preprocessor works. +#[test] +fn nop_preprocessor() { + BookTest::from_dir("preprocessor/nop_preprocessor").run("build", |cmd| { + cmd.expect_stdout(str![[""]]).expect_stderr(str![[r#" +[TIMESTAMP] [INFO] (mdbook::book): Book building has started +[TIMESTAMP] [INFO] (mdbook::book): Running the html backend + +"#]]); + }); +} diff --git a/tests/testsuite/preprocessor/nop_preprocessor/book.toml b/tests/testsuite/preprocessor/nop_preprocessor/book.toml new file mode 100644 index 00000000..5532d943 --- /dev/null +++ b/tests/testsuite/preprocessor/nop_preprocessor/book.toml @@ -0,0 +1,2 @@ +[preprocessor.nop-preprocessor] +command = "cargo run --quiet --example nop-preprocessor --" diff --git a/tests/testsuite/preprocessor/nop_preprocessor/src/SUMMARY.md b/tests/testsuite/preprocessor/nop_preprocessor/src/SUMMARY.md new file mode 100644 index 00000000..e69de29b