Move cli tests to their own subdir
This commit is contained in:
parent
11b1e86187
commit
9bede85efa
|
@ -0,0 +1,29 @@
|
||||||
|
use crate::dummy_book::DummyBook;
|
||||||
|
|
||||||
|
use assert_cmd::Command;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn mdbook_cli_dummy_book_generates_index_html() {
|
||||||
|
let temp = DummyBook::new().build().unwrap();
|
||||||
|
|
||||||
|
// doesn't exist before
|
||||||
|
assert!(!temp.path().join("book").exists());
|
||||||
|
|
||||||
|
let mut cmd = Command::cargo_bin("mdbook").unwrap();
|
||||||
|
cmd.arg("build").current_dir(temp.path());
|
||||||
|
cmd.assert()
|
||||||
|
.success()
|
||||||
|
.stderr(
|
||||||
|
predicates::str::is_match(r##"Stack depth exceeded in first[\\/]recursive.md."##)
|
||||||
|
.unwrap(),
|
||||||
|
)
|
||||||
|
.stderr(predicates::str::contains(
|
||||||
|
r##"[INFO] (mdbook::book): Running the html backend"##,
|
||||||
|
));
|
||||||
|
|
||||||
|
// exists afterward
|
||||||
|
assert!(temp.path().join("book").exists());
|
||||||
|
|
||||||
|
let index_file = temp.path().join("book/index.html");
|
||||||
|
assert!(index_file.exists());
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
mod build;
|
||||||
|
mod test;
|
|
@ -1,5 +1,3 @@
|
||||||
mod dummy_book;
|
|
||||||
|
|
||||||
use crate::dummy_book::DummyBook;
|
use crate::dummy_book::DummyBook;
|
||||||
|
|
||||||
use assert_cmd::Command;
|
use assert_cmd::Command;
|
||||||
|
@ -34,29 +32,3 @@ fn mdbook_cli_detects_book_with_failing_tests() {
|
||||||
.stderr(predicates::str::is_match(r##"rustdoc returned an error:\n\n"##).unwrap())
|
.stderr(predicates::str::is_match(r##"rustdoc returned an error:\n\n"##).unwrap())
|
||||||
.stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap());
|
.stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn mdbook_cli_dummy_book_generates_index_html() {
|
|
||||||
let temp = DummyBook::new().build().unwrap();
|
|
||||||
|
|
||||||
// doesn't exist before
|
|
||||||
assert!(!temp.path().join("book").exists());
|
|
||||||
|
|
||||||
let mut cmd = Command::cargo_bin("mdbook").unwrap();
|
|
||||||
cmd.arg("build").current_dir(temp.path());
|
|
||||||
cmd.assert()
|
|
||||||
.success()
|
|
||||||
.stderr(
|
|
||||||
predicates::str::is_match(r##"Stack depth exceeded in first[\\/]recursive.md."##)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.stderr(predicates::str::contains(
|
|
||||||
r##"[INFO] (mdbook::book): Running the html backend"##,
|
|
||||||
));
|
|
||||||
|
|
||||||
// exists afterward
|
|
||||||
assert!(temp.path().join("book").exists());
|
|
||||||
|
|
||||||
let index_file = temp.path().join("book/index.html");
|
|
||||||
assert!(index_file.exists());
|
|
||||||
}
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
mod cli;
|
||||||
|
mod dummy_book;
|
Loading…
Reference in New Issue