summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2013-01-05 09:06:47 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:16 -0700
commitbdd71823d47665a0e467ef85887bc528d4a34ef0 (patch)
tree8bb676fb6279bcb53301bd075a644c901d5a97d0 /spec/support
parentf9902ce0d14ee0f69726c69c128fd0d2c5c2b616 (diff)
downloadchef-bdd71823d47665a0e467ef85887bc528d4a34ef0.tar.gz
Fix bug where it thought you were in "cookbooks1" when you were really in "cookbooks123"
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared/integration/integration_helper.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/support/shared/integration/integration_helper.rb b/spec/support/shared/integration/integration_helper.rb
index b15e90c440..843bf7d0c5 100644
--- a/spec/support/shared/integration/integration_helper.rb
+++ b/spec/support/shared/integration/integration_helper.rb
@@ -33,20 +33,25 @@ module IntegrationSupport
raise "Can only create one directory per test" if @repository_dir
@repository_dir = Dir.mktmpdir('chef_repo')
@old_chef_repo_path = Chef::Config.chef_repo_path
- @old_cookbook_path = Chef::Config.cookbook_path
+ @old_paths = {}
Chef::Config.chef_repo_path = @repository_dir
- Chef::Config.cookbook_path = File.join(@repository_dir, 'cookbooks')
+ %w(client cookbook data_bag environment node role user).each do |object_name|
+ @old_paths[object_name] = Chef::Config["#{object_name}_path".to_sym]
+ Chef::Config["#{object_name}_path".to_sym] = nil
+ end
end
after :each do
if @repository_dir
begin
+ %w(client cookbook data_bag environment node role user).each do |object_name|
+ Chef::Config["#{object_name}_path".to_sym] = @old_paths[object_name]
+ end
Chef::Config.chef_repo_path = @old_chef_repo_path
- Chef::Config.cookbook_path = @old_cookbook_path
FileUtils.remove_entry_secure(@repository_dir)
ensure
@old_chef_repo_path = nil
- @old_cookbook_path = nil
+ @old_paths = nil
@repository_dir = nil
end
end