Migrate (no theme) default fonts to BookTest
This commit is contained in:
parent
dd27c4f8ba
commit
0274ad6e87
2 changed files with 26 additions and 8 deletions
|
|
@ -339,14 +339,6 @@ fn custom_fonts() {
|
||||||
contents.contains("fonts/fonts.css")
|
contents.contains("fonts/fonts.css")
|
||||||
};
|
};
|
||||||
|
|
||||||
// No theme:
|
|
||||||
let temp = TempFileBuilder::new().prefix("mdbook").tempdir().unwrap();
|
|
||||||
let p = temp.path();
|
|
||||||
MDBook::init(p).build().unwrap();
|
|
||||||
MDBook::load(p).unwrap().build().unwrap();
|
|
||||||
assert_eq!(actual_files(&p.join("book/fonts")), &builtin_fonts);
|
|
||||||
assert!(has_fonts_css(p));
|
|
||||||
|
|
||||||
// Full theme.
|
// Full theme.
|
||||||
let temp = TempFileBuilder::new().prefix("mdbook").tempdir().unwrap();
|
let temp = TempFileBuilder::new().prefix("mdbook").tempdir().unwrap();
|
||||||
let p = temp.path();
|
let p = temp.path();
|
||||||
|
|
|
||||||
|
|
@ -42,3 +42,29 @@ This is a modified index.hbs!
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// After building, what are the default set of fonts?
|
||||||
|
#[test]
|
||||||
|
fn default_fonts() {
|
||||||
|
BookTest::init(|_| {})
|
||||||
|
.check_file_contains("book/index.html", "fonts/fonts.css")
|
||||||
|
.check_file_list(
|
||||||
|
"book/fonts",
|
||||||
|
str![[r#"
|
||||||
|
book/fonts/OPEN-SANS-LICENSE.txt
|
||||||
|
book/fonts/SOURCE-CODE-PRO-LICENSE.txt
|
||||||
|
book/fonts/fonts.css
|
||||||
|
book/fonts/open-sans-v17-all-charsets-300.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-300italic.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-600.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-600italic.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-700.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-700italic.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-800.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-800italic.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-italic.woff2
|
||||||
|
book/fonts/open-sans-v17-all-charsets-regular.woff2
|
||||||
|
book/fonts/source-code-pro-v11-all-charsets-500.woff2
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue