mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-12 22:02:37 +00:00
Tested MDBook::init with custom args
This commit is contained in:
parent
29e00c0d97
commit
0c3a2b80f8
1 changed files with 20 additions and 0 deletions
|
@ -21,3 +21,23 @@ fn run_mdbook_init() {
|
|||
assert!(temp.path().join(file).exists(), "{} doesn't exist", file);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn run_mdbook_init_with_custom_args() {
|
||||
let created_files = vec!["out", "in", "in/SUMMARY.md", "in/chapter_1.md"];
|
||||
|
||||
let temp = TempDir::new("mdbook").unwrap();
|
||||
for file in &created_files {
|
||||
assert!(!temp.path().join(file).exists());
|
||||
}
|
||||
|
||||
let mut md = MDBook::new(temp.path())
|
||||
.with_source("in")
|
||||
.with_destination("out");
|
||||
|
||||
md.init().unwrap();
|
||||
|
||||
for file in &created_files {
|
||||
assert!(temp.path().join(file).exists(), "{} doesn't exist", file);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue