summaryrefslogtreecommitdiff
path: root/spec/unit/config_spec.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/unit/config_spec.rb
parent76c9d133b24274f8d03d5ad363ab1a85d13ff5f5 (diff)
downloadchef-04e30daab94a6c1e5c2e28efb3691afdd48ed3f2.tar.gz
Use Chef::Config.reset in tests instead of save/load config
Diffstat (limited to 'spec/unit/config_spec.rb')
-rw-r--r--spec/unit/config_spec.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 5d10b6927b..0460e4dc71 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -22,10 +22,18 @@ require 'chef/exceptions'
describe Chef::Config do
before(:all) do
- @original_config = Chef::Config.hash_dup
@original_env = { 'HOME' => ENV['HOME'], 'SYSTEMDRIVE' => ENV['SYSTEMDRIVE'], 'HOMEPATH' => ENV['HOMEPATH'], 'USERPROFILE' => ENV['USERPROFILE'] }
end
+ before :each do
+ Chef::Config.reset
+ end
+
+ after :all do
+ # Be a good citizen
+ Chef::Config.reset
+ end
+
describe "config attribute writer: chef_server_url" do
before do
Chef::Config.chef_server_url = "https://junglist.gen.nz"
@@ -278,8 +286,4 @@ describe Chef::Config do
expect{Chef::Config.log_location = missing_path}.to raise_error Chef::Exceptions::ConfigurationError
end
end
-
- after(:each) do
- Chef::Config.configuration = @original_config
- end
end