summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMal Graty <mal.graty@googlemail.com>2013-03-06 09:31:25 +0000
committerBryan McLellan <btm@opscode.com>2013-05-24 07:12:45 -0700
commit2de2f4a4cde5a58247caaf1d2b8a1a10c8d3a024 (patch)
tree27b7cbf090c4041c65f2053b49e957f2573af418
parent4cc156b3b308c879502f86a3de6d44737e1b1920 (diff)
downloadchef-2de2f4a4cde5a58247caaf1d2b8a1a10c8d3a024.tar.gz
Improve deprecation warning
-rw-r--r--lib/chef/cookbook/cookbook_version_loader.rb2
-rw-r--r--spec/unit/cookbook_loader_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb
index a990489ff6..77db236eca 100644
--- a/lib/chef/cookbook/cookbook_version_loader.rb
+++ b/lib/chef/cookbook/cookbook_version_loader.rb
@@ -107,7 +107,7 @@ class Chef
raise RuntimeError, "Invalid metadata file: #{metadata_file} for cookbook: #{cookbook_version}"
end
end
- Chef::Log.warn "Inferred cookbook names are deprecated, please set a name in metadata" unless @metadata.name
+ Chef::Log.warn "Inferring cookbook name from directory name (#@cookbook_pathname) is deprecated, please set a name in the metadata." unless @metadata.name
@metadata
end
diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb
index 5bd7b62183..17e189cd6c 100644
--- a/spec/unit/cookbook_loader_spec.rb
+++ b/spec/unit/cookbook_loader_spec.rb
@@ -172,7 +172,7 @@ describe Chef::CookbookLoader do
end
it "should emit deprecation warning if name is not in metadata" do
- Chef::Log.should_receive(:warn).exactly(6).with("Inferred cookbook names are deprecated, please set a name in metadata")
+ Chef::Log.should_receive(:warn).exactly(6).with(/Inferring cookbook name from directory name \([^)]+\) is deprecated, please set a name in the metadata./)
@cookbook_loader.load_cookbooks
end
end # load_cookbooks