summaryrefslogtreecommitdiff
path: root/spec/functional/resource
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-06-13 09:59:28 -0700
committerdanielsdeleo <dan@opscode.com>2013-06-13 09:59:28 -0700
commit35da53b9dd889045ecea1b48e70a1dcb5ababc9e (patch)
tree7556c60ae24bd799c3c2a092f1421943eed4a9e0 /spec/functional/resource
parent83ad7d9aeb3f7c4b752dd92d4ca1f3671a0ab9ac (diff)
downloadchef-35da53b9dd889045ecea1b48e70a1dcb5ababc9e.tar.gz
set git user configuration to avoid prompting
Depending on environment, git may prompt you to configure username and email when committing an annotated tag. Set local configuration in the repo to work around this.
Diffstat (limited to 'spec/functional/resource')
-rw-r--r--spec/functional/resource/git_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/functional/resource/git_spec.rb b/spec/functional/resource/git_spec.rb
index 5658738064..7ade6eea21 100644
--- a/spec/functional/resource/git_spec.rb
+++ b/spec/functional/resource/git_spec.rb
@@ -64,9 +64,19 @@ describe Chef::Resource::Git do
let(:rev_testing) { "972d153654503bccec29f630c5dd369854a561e8" }
let(:rev_head) { "d294fbfd05aa7709ad9a9b8ef6343b17d355bf5f"}
+ let(:git_user_config) do
+ <<-E
+[user]
+ name = frodoTbaggins
+ email = frodo@shire.org
+E
+ end
+
before(:each) do
+ Chef::Log.level = :warn # silence git command live streams
@old_file_cache_path = Chef::Config[:file_cache_path]
shell_out!("git clone \"#{git_bundle_repo}\" example", :cwd => origin_repo_dir)
+ File.open("#{origin_repo}/.git/config", "a+") {|f| f.print(git_user_config) }
Chef::Config[:file_cache_path] = file_cache_path
end