summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2016-01-19 15:22:23 -0700
committertyler-ball <tyleraball@gmail.com>2016-01-20 13:56:44 -0700
commit5cf2266414afa29851c81fffbf7d593ba9810de6 (patch)
tree4873359cc43607ad72da6966e3bd4b6b26d851bb /spec
parenta6d897235eecca34629e9d7330c2ba5e7a8ab3fe (diff)
downloadchef-5cf2266414afa29851c81fffbf7d593ba9810de6.tar.gz
Sometimes chocolately doesn't appear on the path, so adding two fixes.tball/win2008r2_test_failures
First, making powershell raise if there is an exception installing. Second, add choco to the path if it isn't already there.
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/chocolatey_package_spec.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb
index 39baa7ffce..7cbaaf0d6b 100644
--- a/spec/functional/resource/chocolatey_package_spec.rb
+++ b/spec/functional/resource/chocolatey_package_spec.rb
@@ -23,6 +23,9 @@ describe Chef::Resource::ChocolateyPackage, :windows_only do
before(:all) do
powershell_out!("iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))")
+ unless ENV["PATH"] =~ /chocolatey\\bin/
+ ENV["PATH"] = "C:\\ProgramData\\chocolatey\\bin;#{ENV["PATH"]}"
+ end
end
let(:package_name) { "test-A" }