Migrate process_the_dummy_book to BookTest
This commit is contained in:
parent
b4221680e4
commit
fca149a52c
4 changed files with 14 additions and 10 deletions
|
|
@ -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();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -40,3 +40,15 @@ fn runs_preprocessors() {
|
||||||
assert_eq!(inner.run_count, 1);
|
assert_eq!(inner.run_count, 1);
|
||||||
assert_eq!(inner.rendered_with, ["html"]);
|
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
|
||||||
|
|
||||||
|
"#]]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
2
tests/testsuite/preprocessor/nop_preprocessor/book.toml
Normal file
2
tests/testsuite/preprocessor/nop_preprocessor/book.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[preprocessor.nop-preprocessor]
|
||||||
|
command = "cargo run --quiet --example nop-preprocessor --"
|
||||||
Loading…
Add table
Reference in a new issue