summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2014-08-10 12:41:29 -0700
committerdanielsdeleo <dan@getchef.com>2014-08-12 11:03:10 -0700
commit3cae751aa5174735b9e0b38b885752125e10ec6b (patch)
tree6a4598941444cbcfb01f96eeb6f2e243170df859 /spec
parent2577c6f8f503dd6484ca656c9b3780c52cc6e038 (diff)
downloadchef-3cae751aa5174735b9e0b38b885752125e10ec6b.tar.gz
Add `name' attribute in fixture cookbooks' metadata
Diffstat (limited to 'spec')
-rw-r--r--spec/integration/knife/chef_fs_data_store_spec.rb11
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb2
-rw-r--r--spec/integration/solo/solo_spec.rb12
3 files changed, 16 insertions, 9 deletions
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb
index da1c72bd0c..c6737e08cb 100644
--- a/spec/integration/knife/chef_fs_data_store_spec.rb
+++ b/spec/integration/knife/chef_fs_data_store_spec.rb
@@ -26,10 +26,13 @@ describe 'ChefFSDataStore tests' do
include IntegrationSupport
include KnifeSupport
+ let(:cookbook_x_100_metadata_rb) { cb_metadata("x", "1.0.0") }
+ let(:cookbook_z_100_metadata_rb) { cb_metadata("z", "1.0.0") }
+
when_the_repository "has one of each thing" do
before do
file 'clients/x.json', {}
- file 'cookbooks/x/metadata.rb', 'version "1.0.0"'
+ file 'cookbooks/x/metadata.rb', cookbook_x_100_metadata_rb
file 'data_bags/x/y.json', {}
file 'environments/x.json', {}
file 'nodes/x.json', {}
@@ -108,7 +111,7 @@ EOM
end
it 'knife show -z /cookbooks/x/metadata.rb works' do
- knife('show -z /cookbooks/x/metadata.rb').should_succeed "/cookbooks/x/metadata.rb:\nversion \"1.0.0\"\n"
+ knife('show -z /cookbooks/x/metadata.rb').should_succeed "/cookbooks/x/metadata.rb:\n#{cookbook_x_100_metadata_rb}\n"
end
it 'knife show -z /data_bags/x/y.json works' do
@@ -136,7 +139,7 @@ EOM
before do
file 'empty.json', {}
file 'rolestuff.json', '{"description":"hi there","name":"x"}'
- file 'cookbooks_to_upload/x/metadata.rb', "version '1.0.0'\n\n"
+ file 'cookbooks_to_upload/x/metadata.rb', cookbook_x_100_metadata_rb
end
it 'knife raw -z -i empty.json -m PUT /clients/x' do
@@ -196,7 +199,7 @@ EOM
file 'empty_x.json', { 'name' => 'x' }
file 'empty_id.json', { 'id' => 'z' }
file 'rolestuff.json', '{"description":"hi there","name":"x"}'
- file 'cookbooks_to_upload/z/metadata.rb', "version '1.0.0'"
+ file 'cookbooks_to_upload/z/metadata.rb', cookbook_z_100_metadata_rb
end
it 'knife raw -z -i empty.json -m POST /clients' do
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index ac2538dc38..b3efae6cd3 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -101,7 +101,7 @@ END_CLIENT_RB
it "downloads the cookbook" do
shell_out!("knife cookbook download apache2 #{knife_config_flag} -d #{cache_path}", :cwd => chef_dir)
- Dir["#{cache_path}/*"].map {|entry| File.basename(entry)}.should include("apache2-0.0.0")
+ Dir["#{cache_path}/*"].map {|entry| File.basename(entry)}.should include("apache2-0.0.1")
end
end
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index b10ff379e2..793789b754 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -11,9 +11,13 @@ describe "chef-solo" do
let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..") }
+ let(:cookbook_x_100_metadata_rb) { cb_metadata("x", "1.0.0") }
+
+ let(:cookbook_ancient_100_metadata_rb) { cb_metadata("ancient", "1.0.0") }
+
when_the_repository "has a cookbook with a basic recipe" do
before do
- file 'cookbooks/x/metadata.rb', 'version "1.0.0"'
+ file 'cookbooks/x/metadata.rb', cookbook_x_100_metadata_rb
file 'cookbooks/x/recipes/default.rb', 'puts "ITWORKS"'
end
@@ -46,10 +50,10 @@ E
when_the_repository "has a cookbook with an undeclared dependency" do
before do
- file 'cookbooks/x/metadata.rb', 'version "1.0.0"'
+ file 'cookbooks/x/metadata.rb', cookbook_x_100_metadata_rb
file 'cookbooks/x/recipes/default.rb', 'include_recipe "ancient::aliens"'
- file 'cookbooks/ancient/metadata.rb', 'version "1.0.0"'
+ file 'cookbooks/ancient/metadata.rb', cookbook_ancient_100_metadata_rb
file 'cookbooks/ancient/recipes/aliens.rb', 'print "it was aliens"'
end
@@ -69,7 +73,7 @@ EOM
before do
directory 'logs'
file 'logs/runs.log', ''
- file 'cookbooks/x/metadata.rb', 'version "1.0.0"'
+ file 'cookbooks/x/metadata.rb', cookbook_x_100_metadata_rb
file 'cookbooks/x/recipes/default.rb', <<EOM
ruby_block "sleeping" do
block do