2017-11-16 15:51:12 +08:00
|
|
|
mod dummy_book;
|
2017-09-02 07:40:39 +08:00
|
|
|
|
2019-05-26 02:50:41 +08:00
|
|
|
use crate::dummy_book::DummyBook;
|
2018-01-17 06:13:47 +08:00
|
|
|
|
2018-07-24 01:45:01 +08:00
|
|
|
use mdbook::MDBook;
|
2017-07-10 18:17:19 +08:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn mdbook_can_correctly_test_a_passing_book() {
|
2017-11-16 15:51:12 +08:00
|
|
|
let temp = DummyBook::new().with_passing_test(true).build().unwrap();
|
2017-11-18 20:41:04 +08:00
|
|
|
let mut md = MDBook::load(temp.path()).unwrap();
|
2017-07-10 18:17:19 +08:00
|
|
|
|
|
|
|
assert!(md.test(vec![]).is_ok());
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn mdbook_detects_book_with_failing_tests() {
|
2017-11-16 15:51:12 +08:00
|
|
|
let temp = DummyBook::new().with_passing_test(false).build().unwrap();
|
2018-07-26 01:17:17 +08:00
|
|
|
let mut md = MDBook::load(temp.path()).unwrap();
|
2017-07-10 18:17:19 +08:00
|
|
|
|
|
|
|
assert!(md.test(vec![]).is_err());
|
2017-09-02 07:40:39 +08:00
|
|
|
}
|