Skip to content

Commit

Permalink
Add test for GIT_COMMITTER_EMAIL when cargo new
Browse files Browse the repository at this point in the history
There was no test for `GIT_COMMITER_EMAIL`, so I add the test for
this. In addition, I update the name of some tests.
  • Loading branch information
giraffate committed Dec 5, 2019
1 parent 0e186bf commit 058937f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ fn finds_local_author_git() {
}

#[cargo_test]
fn finds_git_email() {
fn finds_git_author() {
cargo_process("new foo")
.env("GIT_AUTHOR_NAME", "foo")
.env("GIT_AUTHOR_EMAIL", "gitfoo")
Expand All @@ -303,11 +303,12 @@ fn finds_git_email() {
}

#[cargo_test]
fn finds_git_author() {
fn finds_git_committer() {
create_empty_gitconfig();
cargo_process("new foo")
.env_remove("USER")
.env("GIT_COMMITTER_NAME", "gitfoo")
.env("GIT_COMMITTER_NAME", "foo")
.env("GIT_COMMITTER_EMAIL", "gitfoo")
.run();

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

#[cargo_test]
Expand Down

0 comments on commit 058937f

Please sign in to comment.