summaryrefslogtreecommitdiffstats
path: root/vendor/mdbook/tests/testing.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/mdbook/tests/testing.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/mdbook/tests/testing.rs b/vendor/mdbook/tests/testing.rs
index 2b2c0fd0d..3030c5cb6 100644
--- a/vendor/mdbook/tests/testing.rs
+++ b/vendor/mdbook/tests/testing.rs
@@ -24,3 +24,24 @@ fn mdbook_detects_book_with_failing_tests() {
assert!(md.test(vec![]).is_err());
}
+
+#[test]
+fn mdbook_test_chapter() {
+ let temp = DummyBook::new().with_passing_test(true).build().unwrap();
+ let mut md = MDBook::load(temp.path()).unwrap();
+
+ let result = md.test_chapter(vec![], Some("Introduction"));
+ assert!(
+ result.is_ok(),
+ "test_chapter failed with {}",
+ result.err().unwrap()
+ );
+}
+
+#[test]
+fn mdbook_test_chapter_not_found() {
+ let temp = DummyBook::new().with_passing_test(true).build().unwrap();
+ let mut md = MDBook::load(temp.path()).unwrap();
+
+ assert!(md.test_chapter(vec![], Some("Bogus Chapter Name")).is_err());
+}