summaryrefslogtreecommitdiff
path: root/spec/support/shared/integration/integration_helper.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-09-13 15:25:30 -0700
committerJohn Keiser <jkeiser@opscode.com>2013-09-13 15:25:30 -0700
commit04e30daab94a6c1e5c2e28efb3691afdd48ed3f2 (patch)
treec0ee7b85beb645f30fc6af979b81cf930715367e /spec/support/shared/integration/integration_helper.rb
parent76c9d133b24274f8d03d5ad363ab1a85d13ff5f5 (diff)
downloadchef-04e30daab94a6c1e5c2e28efb3691afdd48ed3f2.tar.gz
Use Chef::Config.reset in tests instead of save/load config
Diffstat (limited to 'spec/support/shared/integration/integration_helper.rb')
-rw-r--r--spec/support/shared/integration/integration_helper.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/spec/support/shared/integration/integration_helper.rb b/spec/support/shared/integration/integration_helper.rb
index 359072a197..5a86abb45b 100644
--- a/spec/support/shared/integration/integration_helper.rb
+++ b/spec/support/shared/integration/integration_helper.rb
@@ -30,14 +30,10 @@ module IntegrationSupport
def self.extended(base)
base.before :each do
- # We mess with Chef::Config a lot. Save and restore it.
- @old_chef_config = Chef::Config.configuration
- Chef::Config.configuration = Chef::Config.configuration.dup
- Chef::Config.repo_mode = nil
- Chef::Config.versioned_cookbooks = nil
+ Chef::Config.reset
end
- base.after :each do
- Chef::Config.configuration = @old_chef_config
+ base.after :all do
+ Chef::Config.reset
end
end
@@ -145,7 +141,7 @@ module IntegrationSupport
_m = { :versioned_cookbooks => true }.merge(_metadata)
context 'with versioned cookbooks', _m do
before(:each) { Chef::Config[:versioned_cookbooks] = true }
- after(:each) { Chef::Config[:versioned_cookbooks] = false }
+ after(:each) { Chef::Config.delete(:versioned_cookbooks) }
instance_eval(&block)
end
end
@@ -155,6 +151,7 @@ module IntegrationSupport
context 'with versioned cookbooks', _m do
# Just make sure this goes back to default
before(:each) { Chef::Config[:versioned_cookbooks] = false }
+ after(:each) { Chef::Config.delete(:versioned_cookbooks) }
instance_eval(&block)
end
end