mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-13 14:22:35 +00:00
2a2b51c8ab
nixpkgs build system sets `RUST_LOG=` (empty value) by default. This switches `mdBook` into warnings+ mode (instead of info+). This causes the following tests to fail: $ RUST_LOG= cargo test --test cli_tests ... cli::test::mdbook_cli_can_correctly_test_a_passing_book cli::test::mdbook_cli_detects_book_with_failing_tests cli::build::mdbook_cli_dummy_book_generates_index_html The change drops RUST_LOG= entry.
28 lines
809 B
Rust
28 lines
809 B
Rust
use crate::cli::cmd::mdbook_cmd;
|
|
use crate::dummy_book::DummyBook;
|
|
|
|
#[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 = mdbook_cmd();
|
|
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());
|
|
}
|