Skip to content

Commit 058937f

Browse files
committed
Add test for GIT_COMMITTER_EMAIL when cargo new
There was no test for `GIT_COMMITER_EMAIL`, so I add the test for this. In addition, I update the name of some tests.
1 parent 0e186bf commit 058937f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/testsuite/new.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn finds_local_author_git() {
287287
}
288288

289289
#[cargo_test]
290-
fn finds_git_email() {
290+
fn finds_git_author() {
291291
cargo_process("new foo")
292292
.env("GIT_AUTHOR_NAME", "foo")
293293
.env("GIT_AUTHOR_EMAIL", "gitfoo")
@@ -303,11 +303,12 @@ fn finds_git_email() {
303303
}
304304

305305
#[cargo_test]
306-
fn finds_git_author() {
306+
fn finds_git_committer() {
307307
create_empty_gitconfig();
308308
cargo_process("new foo")
309309
.env_remove("USER")
310-
.env("GIT_COMMITTER_NAME", "gitfoo")
310+
.env("GIT_COMMITTER_NAME", "foo")
311+
.env("GIT_COMMITTER_EMAIL", "gitfoo")
311312
.run();
312313

313314
let toml = paths::root().join("foo/Cargo.toml");
@@ -316,7 +317,7 @@ fn finds_git_author() {
316317
.unwrap()
317318
.read_to_string(&mut contents)
318319
.unwrap();
319-
assert!(contents.contains(r#"authors = ["gitfoo"]"#));
320+
assert!(contents.contains(r#"authors = ["foo <gitfoo>"]"#));
320321
}
321322

322323
#[cargo_test]

0 commit comments

Comments
 (0)