summaryrefslogtreecommitdiff
path: root/spec/functional/resource
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-10-21 13:50:50 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2014-10-21 13:50:50 -0700
commitd77a51f05082a41a92ffa21a474ac174454a0ed9 (patch)
tree3d090a1501a2327fdb09385368bf568e23dda5b8 /spec/functional/resource
parentc6d783739fa157bc886c14cece894baf783e6a89 (diff)
parente12eb0e2f98d8e2bf2117682c284bc7a71a9c715 (diff)
downloadchef-d77a51f05082a41a92ffa21a474ac174454a0ed9.tar.gz
Merge pull request #2249 from opscode/jdmundrawala/delete-env
Ensure delete ENV[var] from current process
Diffstat (limited to 'spec/functional/resource')
-rwxr-xr-xspec/functional/resource/env_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/functional/resource/env_spec.rb b/spec/functional/resource/env_spec.rb
index cf77fef703..8178eeba3d 100755
--- a/spec/functional/resource/env_spec.rb
+++ b/spec/functional/resource/env_spec.rb
@@ -22,6 +22,7 @@ describe Chef::Resource::Env, :windows_only do
context 'when running on Windows' do
let(:chef_env_test_lower_case) { 'chefenvtest' }
let(:chef_env_test_mixed_case) { 'chefENVtest' }
+ let(:env_dne_key) { 'env_dne_key' }
let(:env_value1) { 'value1' }
let(:env_value2) { 'value2' }
@@ -177,6 +178,14 @@ describe Chef::Resource::Env, :windows_only do
expect(ENV[chef_env_test_lower_case]).to eq(nil)
expect(ENV[chef_env_test_mixed_case]).to eq(nil)
end
+
+ it "should delete a value from the current process even if it is not in the registry" do
+ expect(ENV[env_dne_key]).to eq(nil)
+ ENV[env_dne_key] = env_value1
+ test_resource.key_name(env_dne_key)
+ test_resource.run_action(:delete)
+ expect(ENV[env_dne_key]).to eq(nil)
+ end
end
end
end