use mdbook::MDBook;
#[test]
fn github_authors_works() {
std::env::set_current_dir("test_book").unwrap();
let book = MDBook::load(".").unwrap();
book.build().unwrap();
let ch1 = std::fs::read_to_string("book/chapter_1/index.html").unwrap();
let ch1_1 = std::fs::read_to_string("book/chapter_1/sub_chapter_1.html").unwrap();
let ch1_2 = std::fs::read_to_string("book/chapter_1/sub_chapter_2.html").unwrap();
assert!(
ch1.contains("<hr style=\"border: none; border-top: 1px solid #ddd; margin: 20px 0;\">")
);
assert!(ch1.contains("<strong>Contributors:</strong>"));
assert!(ch1.contains("<a href=\"https://github.com/nerdai\">"));
assert!(!ch1_1.contains("<strong>Contributors:</strong>"));
assert!(ch1_2.contains("<a href=\"https://github.com/nerdai\">"));
assert!(ch1_2.contains("<a href=\"https://github.com/emersodb\">"));
}