The example book renders correctly
This commit is contained in:
parent
751da4f05f
commit
12d1ed5558
|
@ -114,3 +114,13 @@ fn recursive_copy<A: AsRef<Path>, B: AsRef<Path>>(from: A, to: B) -> Result<()>
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_copy_of_example_book() -> Result<TempDir> {
|
||||||
|
let temp = TempDir::new("book-example")?;
|
||||||
|
|
||||||
|
let book_example = Path::new(env!("CARGO_MANIFEST_DIR")).join("book-example");
|
||||||
|
|
||||||
|
recursive_copy(book_example, temp.path())?;
|
||||||
|
|
||||||
|
Ok(temp)
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ extern crate pretty_assertions;
|
||||||
extern crate select;
|
extern crate select;
|
||||||
extern crate tempdir;
|
extern crate tempdir;
|
||||||
extern crate walkdir;
|
extern crate walkdir;
|
||||||
|
extern crate tempdir;
|
||||||
|
|
||||||
mod dummy_book;
|
mod dummy_book;
|
||||||
|
|
||||||
|
@ -297,3 +298,13 @@ fn able_to_include_rust_files_in_chapters() {
|
||||||
];
|
];
|
||||||
assert_contains_strings(second, playpen_strings);
|
assert_contains_strings(second, playpen_strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn example_book_can_build() {
|
||||||
|
let example_book_dir = dummy_book::new_copy_of_example_book().unwrap();
|
||||||
|
|
||||||
|
let mut md = MDBook::load(example_book_dir.path()).unwrap();
|
||||||
|
|
||||||
|
let got = md.build();
|
||||||
|
assert!(got.is_ok());
|
||||||
|
}
|
Loading…
Reference in New Issue