summaryrefslogtreecommitdiff
path: root/spec/unit/knife
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2014-03-26 16:39:34 -0700
committerdanielsdeleo <dan@getchef.com>2014-03-27 12:04:14 -0700
commita5a8c9812d6b25f91f4c47d0286f96b15d28a107 (patch)
treed394ad2cae4ace00402bef93d89bd7deb4ba8758 /spec/unit/knife
parente977a47fe6a2b5e481d4850094302ba0521f5a27 (diff)
downloadchef-a5a8c9812d6b25f91f4c47d0286f96b15d28a107.tar.gz
Add regression test for cookbook overlay warning
Diffstat (limited to 'spec/unit/knife')
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb
index c9f10f40e2..5c7a4c1125 100644
--- a/spec/unit/knife/cookbook_upload_spec.rb
+++ b/spec/unit/knife/cookbook_upload_spec.rb
@@ -101,6 +101,30 @@ describe Chef::Knife::CookbookUpload do
end
end
+ context "when uploading a cookbook that uses deprecated overlays" do
+
+ before do
+ cookbook_loader.stub(:merged_cookbooks).and_return(['test_cookbook'])
+ cookbook_loader.stub(:merged_cookbook_paths).
+ and_return({'test_cookbook' => %w{/path/one/test_cookbook /path/two/test_cookbook}})
+ end
+
+ it "emits a warning" do
+ knife.run
+ expected_message=<<-E
+WARNING: The cookbooks: test_cookbook exist in multiple places in your cookbook_path.
+A composite version of these cookbooks has been compiled for uploading.
+
+IMPORTANT: In a future version of Chef, this behavior will be removed and you will no longer
+be able to have the same version of a cookbook in multiple places in your cookbook_path.
+WARNING: The affected cookbooks are located:
+test_cookbook:
+ /path/one/test_cookbook
+ /path/two/test_cookbook
+E
+ output.string.should include(expected_message)
+ end
+ end
describe 'when specifying a cookbook name among many' do
let(:name_args) { ['test_cookbook1'] }