diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2013-09-24 20:44:41 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2013-09-24 20:49:48 -0700 |
commit | 5f996956ac5971cd194723b820579e23681192bf (patch) | |
tree | ecbdd6264af684984e8e7c1d0742e9ff7388a9d0 | |
parent | 661a43c61a7927b9a69c79605b2e101f1ac7592f (diff) | |
download | chef-5f996956ac5971cd194723b820579e23681192bf.tar.gz |
use :each, because config is now reset after each
- new code inserted resets in between the before(:all) + after(:all)
-rw-r--r-- | spec/functional/resource/registry_spec.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb index 7662ec7331..8f3cfa9a8a 100644 --- a/spec/functional/resource/registry_spec.rb +++ b/spec/functional/resource/registry_spec.rb @@ -104,8 +104,6 @@ describe Chef::Resource::RegistryKey, :windows_only do @new_resource = Chef::Resource::RegistryKey.new(resource_name, @run_context) @registry = Chef::Win32::Registry.new(@run_context) - @current_whyrun = Chef::Config[:why_run] - reset_registry end @@ -259,12 +257,9 @@ describe Chef::Resource::RegistryKey, :windows_only do end context "while running in whyrun mode" do - before (:all) do + before (:each) do Chef::Config[:why_run] = true end - after (:all) do - Chef::Config[:why_run] = @current_whyrun - end it "does not throw an exception if the keys do not exist but recursive is set to false" do @new_resource.key(reg_child + '\Slitheen\Raxicoricofallapatorius') @@ -373,12 +368,9 @@ describe Chef::Resource::RegistryKey, :windows_only do end context "while running in whyrun mode" do - before (:all) do + before (:each) do Chef::Config[:why_run] = true end - after (:all) do - Chef::Config[:why_run] = @current_whyrun - end it "does not throw an exception if the keys do not exist but recursive is set to false" do @new_resource.key(reg_child + '\Zygons\Zygor') @@ -469,12 +461,9 @@ describe Chef::Resource::RegistryKey, :windows_only do end context "while running in whyrun mode" do - before (:all) do + before (:each) do Chef::Config[:why_run] = true end - after (:all) do - Chef::Config[:why_run] = @current_whyrun - end it "does nothing if the action is delete" do @new_resource.key(reg_parent + '\OpscodeWhyRun') @new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}]) @@ -549,12 +538,9 @@ describe Chef::Resource::RegistryKey, :windows_only do @report["total_res_count"].should == "1" end context "while running in whyrun mode" do - before (:all) do + before (:each) do Chef::Config[:why_run] = true end - after (:all) do - Chef::Config[:why_run] = @current_whyrun - end it "does not throw an exception if the key has subkeys but recursive is set to false" do @new_resource.key(reg_parent + '\OpscodeWhyRun') |