diff options
author | tyler-ball <tyleraball@gmail.com> | 2016-01-19 15:22:23 -0700 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2016-01-20 13:56:44 -0700 |
commit | 5cf2266414afa29851c81fffbf7d593ba9810de6 (patch) | |
tree | 4873359cc43607ad72da6966e3bd4b6b26d851bb /spec | |
parent | a6d897235eecca34629e9d7330c2ba5e7a8ab3fe (diff) | |
download | chef-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.rb | 3 |
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" } |