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