From 5cf2266414afa29851c81fffbf7d593ba9810de6 Mon Sep 17 00:00:00 2001 From: tyler-ball Date: Tue, 19 Jan 2016 15:22:23 -0700 Subject: Sometimes chocolately doesn't appear on the path, so adding two fixes. First, making powershell raise if there is an exception installing. Second, add choco to the path if it isn't already there. --- spec/functional/resource/chocolatey_package_spec.rb | 3 +++ 1 file changed, 3 insertions(+) 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" } -- cgit v1.2.1