Skip to content

Commit 5e60435

Browse files
Add test for init with --ignore git passed
1 parent f93b267 commit 5e60435

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/testsuite/init.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,25 @@ theme/index.hbs
251251
"#]],
252252
);
253253
}
254+
255+
/// Run `mdbook init` with `--ignore git` to create a `.gitignore` file
256+
#[test]
257+
fn init_with_ignore_git_creates_gitignore() {
258+
let mut test = BookTest::empty();
259+
test.run("init --ignore git", |cmd| {
260+
cmd.expect_stdout(str![[r#"
261+
What title would you like to give the book?
262+
263+
All done, no errors...
264+
265+
"#]]);
266+
})
267+
.check_file(
268+
".gitignore",
269+
str![[r#"
270+
book
271+
272+
"#]],
273+
);
274+
assert!(test.dir.join(".gitignore").exists());
275+
}

0 commit comments

Comments
 (0)