mdBook/tests/testing.rs

24 lines
525 B
Rust
Raw Permalink Normal View History

extern crate mdbook;
mod dummy_book;
use dummy_book::DummyBook;
use mdbook::MDBook;
#[test]
fn mdbook_can_correctly_test_a_passing_book() {
let temp = DummyBook::new().with_passing_test(true).build().unwrap();
let mut md = MDBook::new(temp.path());
assert!(md.test(vec![]).is_ok());
}
#[test]
fn mdbook_detects_book_with_failing_tests() {
let temp = DummyBook::new().with_passing_test(false).build().unwrap();
let mut md: MDBook = MDBook::new(temp.path());
assert!(md.test(vec![]).is_err());
}