2018-09-16 23:33:58 +08:00
|
|
|
mod dummy_book;
|
|
|
|
|
|
2019-05-26 01:50:41 +07:00
|
|
|
use crate::dummy_book::DummyBook;
|
2018-09-16 22:49:52 +08:00
|
|
|
use mdbook::preprocess::{CmdPreprocessor, Preprocessor};
|
2018-09-16 23:23:03 +08:00
|
|
|
use mdbook::MDBook;
|
2018-09-16 22:49:52 +08:00
|
|
|
|
|
|
|
|
fn example() -> CmdPreprocessor {
|
2018-12-04 00:11:41 +01:00
|
|
|
CmdPreprocessor::new(
|
|
|
|
|
"nop-preprocessor".to_string(),
|
|
|
|
|
"cargo run --example nop-preprocessor --".to_string(),
|
|
|
|
|
)
|
2018-09-16 22:49:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
2018-09-16 23:00:19 +08:00
|
|
|
fn example_supports_whatever() {
|
2018-09-16 22:49:52 +08:00
|
|
|
let cmd = example();
|
|
|
|
|
|
|
|
|
|
let got = cmd.supports_renderer("whatever");
|
|
|
|
|
|
|
|
|
|
assert_eq!(got, true);
|
|
|
|
|
}
|
2018-09-16 23:00:19 +08:00
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn example_doesnt_support_not_supported() {
|
|
|
|
|
let cmd = example();
|
|
|
|
|
|
|
|
|
|
let got = cmd.supports_renderer("not-supported");
|
|
|
|
|
|
|
|
|
|
assert_eq!(got, false);
|
|
|
|
|
}
|