Skip to content
Snippets Groups Projects
Commit cbc9e5dd authored by Markus Reiter's avatar Markus Reiter Committed by Alyssa Ross
Browse files

tests: re-use with_environment in using_git_env

Proposed by @reitermarkus in
https://github.com/Homebrew/brew/pull/1890#discussion_r97210285.

I made one slight adjustment of preserving the previous date string in
case anything was relying on it.
parent 1e1de8c1
No related branches found
No related tags found
No related merge requests found
......@@ -18,15 +18,15 @@ module Test
end
def using_git_env
initial_env = copy_env
%w[AUTHOR COMMITTER].each do |role|
ENV["GIT_#{role}_NAME"] = "brew tests"
ENV["GIT_#{role}_EMAIL"] = "brew-tests@localhost"
ENV["GIT_#{role}_DATE"] = "Thu May 21 00:04:11 2009 +0100"
git_env = ["AUTHOR", "COMMITTER"].each_with_object({}) do |role, env|
env["GIT_#{role}_NAME"] = "brew tests"
env["GIT_#{role}_EMAIL"] = "brew-tests@localhost"
env["GIT_#{role}_DATE"] = "Thu May 21 00:04:11 2009 +0100"
end
with_environment(git_env) do
yield
end
yield
ensure
restore_env initial_env
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment