1 use crate::dummy_book::DummyBook;
2 
3 use assert_cmd::Command;
4 
5 #[test]
mdbook_cli_dummy_book_generates_index_html()6 fn mdbook_cli_dummy_book_generates_index_html() {
7     let temp = DummyBook::new().build().unwrap();
8 
9     // doesn't exist before
10     assert!(!temp.path().join("book").exists());
11 
12     let mut cmd = Command::cargo_bin("mdbook").unwrap();
13     cmd.arg("build").current_dir(temp.path());
14     cmd.assert()
15         .success()
16         .stderr(
17             predicates::str::is_match(r##"Stack depth exceeded in first[\\/]recursive.md."##)
18                 .unwrap(),
19         )
20         .stderr(predicates::str::contains(
21             r##"[INFO] (mdbook::book): Running the html backend"##,
22         ));
23 
24     // exists afterward
25     assert!(temp.path().join("book").exists());
26 
27     let index_file = temp.path().join("book/index.html");
28     assert!(index_file.exists());
29 }
30