summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-10-26 16:12:40 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-10-26 16:12:40 -0700
commit1a420297efc12ee84de9c3c71be948458d80f17b (patch)
treece13b93cc90dd72a60928a1e2053d874f5f2712d
parent921dad6e7287042161eb2ed08250f094ce54a973 (diff)
downloadchef-1a420297efc12ee84de9c3c71be948458d80f17b.tar.gz
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/cookbook_loader.rb6
-rw-r--r--spec/unit/cookbook_loader_spec.rb1
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb
index 82bab34299..322de539f1 100644
--- a/lib/chef/cookbook_loader.rb
+++ b/lib/chef/cookbook_loader.rb
@@ -75,9 +75,9 @@ class Chef
if @loaded_cookbooks.key?(cookbook_name)
raise Chef::Exceptions::CookbookMergingError, "Cookbook merging is no longer supported, the cookbook named #{cookbook_name} can only appear once in the cookbook_path"
- else
- @loaded_cookbooks[cookbook_name] = loader
end
+
+ @loaded_cookbooks[cookbook_name] = loader
end
if @loaded_cookbooks.key?(cookbook_name)
@@ -101,6 +101,7 @@ class Chef
def has_key?(cookbook_name)
not self[cookbook_name.to_sym].nil?
end
+
alias :cookbook_exists? :has_key?
alias :key? :has_key?
@@ -125,6 +126,7 @@ class Chef
def values
@cookbooks_by_name.values
end
+
alias :cookbooks :values
private
diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb
index 45f03e17b6..15c7d1e299 100644
--- a/spec/unit/cookbook_loader_spec.rb
+++ b/spec/unit/cookbook_loader_spec.rb
@@ -152,7 +152,6 @@ describe Chef::CookbookLoader do
let(:repo_paths) do
[
-# File.join(CHEF_SPEC_DATA, "kitchen"),
File.join(CHEF_SPEC_DATA, "cookbooks"),
File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo"),
]