Skip to content

Commit 1b00525

Browse files
committed
Add test for relative dest-dir
1 parent dbb51d3 commit 1b00525

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/testsuite/build.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,22 @@ fn book_toml_isnt_required() {
6666
str![[r##"<h1 id="chapter-1"><a class="header" href="#chapter-1">Chapter 1</a></h1>"##]],
6767
);
6868
}
69+
70+
// Dest dir relative path behavior.
71+
#[test]
72+
fn dest_dir_relative_path() {
73+
let mut test = BookTest::from_dir("build/basic_build");
74+
let current_dir = test.dir.join("work");
75+
std::fs::create_dir_all(&current_dir).unwrap();
76+
test.run("build", |cmd| {
77+
cmd.args(&["--dest-dir", "foo", ".."])
78+
.current_dir(&current_dir)
79+
.expect_stderr(str![[r#"
80+
[TIMESTAMP] [INFO] (mdbook_driver::mdbook): Book building has started
81+
[TIMESTAMP] [INFO] (mdbook_driver::mdbook): Running the html backend
82+
[TIMESTAMP] [INFO] (mdbook_html::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/work/../foo`
83+
84+
"#]]);
85+
});
86+
assert!(test.dir.join("foo/index.html").exists());
87+
}

0 commit comments

Comments
 (0)