Skip to content

Commit

Permalink
Avoid setting env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
jakzal committed May 30, 2023
1 parent 9b99ab1 commit 3ee2f9a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions test/extension_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ class ExtensionTest < Minitest::Test

def given_file_committed_to_fresh_repo(file_name)
dir = Dir.mktmpdir("asciidoctor-git-include-tests-", "/tmp")
ENV['GIT_AUTHOR_NAME'] = "Test"
ENV['GIT_AUTHOR_EMAIL'] = "test@example.com"
ENV['GIT_COMMITTER_EMAIL'] = "test@example.com"
at_exit {
ENV.delete('GIT_AUTHOR_NAME')
ENV.delete('GIT_AUTHOR_EMAIL')
ENV.delete('GIT_COMMITTER_EMAIL')
FileUtils.remove_entry(dir)
}
cmd = %(git init -q #{dir} && echo 'Other repo.' > #{dir}/#{file_name} && git -C #{dir} add #{dir} && git -C #{dir} commit -m 'Initialise the repo')
cmd = %(git init -q #{dir} && git -C #{dir} config --local user.email test@example.com && git -C #{dir} config --local user.name Test && echo 'Other repo.' > #{dir}/#{file_name} && git -C #{dir} add #{dir} && git -C #{dir} commit -m 'Initialise the repo')
%x{#{cmd}}
dir
end
Expand Down

0 comments on commit 3ee2f9a

Please sign in to comment.