Migrate mdbook_test_chapter_not_found to BookTest
This commit is contained in:
parent
f324aebdec
commit
909bd1c54e
2 changed files with 13 additions and 13 deletions
|
|
@ -1,13 +0,0 @@
|
|||
mod dummy_book;
|
||||
|
||||
use crate::dummy_book::DummyBook;
|
||||
|
||||
use mdbook::MDBook;
|
||||
|
||||
#[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());
|
||||
}
|
||||
|
|
@ -74,3 +74,16 @@ fn test_individual_chapter() {
|
|||
"#]]);
|
||||
});
|
||||
}
|
||||
|
||||
// Unknown chapter name.
|
||||
#[test]
|
||||
fn chapter_not_found() {
|
||||
BookTest::from_dir("test/passing_tests").run("test -c bogus", |cmd| {
|
||||
cmd.expect_failure()
|
||||
.expect_stdout(str![[""]])
|
||||
.expect_stderr(str![[r#"
|
||||
[TIMESTAMP] [ERROR] (mdbook::utils): Error: Chapter not found: bogus
|
||||
|
||||
"#]]);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue