From e12eb0e2f98d8e2bf2117682c284bc7a71a9c715 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Mon, 20 Oct 2014 13:36:54 -0700 Subject: spec to ensure deleting ENV[var] from current process works --- spec/functional/resource/env_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.2.1