diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-10 09:02:27 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-10 09:02:27 -0700 |
commit | 74e213662cb9c24ba5d871c490f481f33564eb7d (patch) | |
tree | 66e88c59c528b7cf829fbdce80e074ef25ef169f | |
parent | b56ff8724a03d089455d7c52f91e07f50c136d8b (diff) | |
download | chef-74e213662cb9c24ba5d871c490f481f33564eb7d.tar.gz |
Fixed potential bug in env_spec
-rwxr-xr-x | spec/functional/resource/env_spec.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/functional/resource/env_spec.rb b/spec/functional/resource/env_spec.rb index 24fe5e1dff..7907234889 100755 --- a/spec/functional/resource/env_spec.rb +++ b/spec/functional/resource/env_spec.rb @@ -127,9 +127,11 @@ describe Chef::Resource::Env, :windows_only 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(:env_path_before) { ENV['PATH'] } it 'should expand PATH' do path_before.should_not include(env_val) + env_path_before.should_not include(env_val) test_resource.key_name('PATH') test_resource.value("#{path_before};#{env_val}") test_resource.run_action(:create) @@ -138,6 +140,7 @@ describe Chef::Resource::Env, :windows_only do end after(:each) do + ENV['PATH'] = env_path_before # cleanup so we don't flood the path test_resource.key_name('PATH') test_resource.value(path_before) |