summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-10-11 08:22:35 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2014-10-11 08:22:35 -0700
commitc28d33e22c7de34217012f11cf17080810b3542d (patch)
treec585ec43d978a5d9c711bedaf06202fb5ebe5004 /spec/functional
parent709c985dd9e637d79df75b0369f86e43ef184e5b (diff)
downloadchef-c28d33e22c7de34217012f11cf17080810b3542d.tar.gz
Deal with nil system path in env_specjdmundrawala/env-path-spec-fix
Diffstat (limited to 'spec/functional')
-rwxr-xr-xspec/functional/resource/env_spec.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/spec/functional/resource/env_spec.rb b/spec/functional/resource/env_spec.rb
index e0a72b2030..cf77fef703 100755
--- a/spec/functional/resource/env_spec.rb
+++ b/spec/functional/resource/env_spec.rb
@@ -126,7 +126,7 @@ describe Chef::Resource::Env, :windows_only do
context 'when using PATH' do
let(:random_name) { Time.now.to_i }
let(:env_val) { "#{env_value_expandable}_#{random_name}"}
- let!(:path_before) { test_resource.provider_for_action(test_resource.action).env_value('PATH') }
+ let!(:path_before) { test_resource.provider_for_action(test_resource.action).env_value('PATH') || '' }
let!(:env_path_before) { ENV['PATH'] }
it 'should expand PATH' do
@@ -143,9 +143,6 @@ describe Chef::Resource::Env, :windows_only do
test_resource.key_name('PATH')
test_resource.value(path_before)
test_resource.run_action(:create)
- if test_resource.provider_for_action(test_resource.action).env_value('PATH') != path_before
- raise 'Failed to cleanup after ourselves'
- end
ENV['PATH'] = env_path_before
end
end