Skip to content

Commit

Permalink
Auto merge of #7666 - giraffate:add_test_for_git_committer_email_when…
Browse files Browse the repository at this point in the history
…_cargo_new, r=alexcrichton

Add test for `GIT_COMMITTER_EMAIL` when `cargo new`

There was no test for `GIT_COMMITTER_EMAIL`, so I add the test for
this. In addition, I update the name of some tests.
  • Loading branch information
bors committed Dec 5, 2019
2 parents ea753af + 058937f commit 904c210
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 904c210

Please sign in to comment.