diff options
Diffstat (limited to 'spec/integration/knife')
43 files changed, 441 insertions, 441 deletions
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb index 79b0307e0d..231f2c6f9a 100644 --- a/spec/integration/knife/chef_fs_data_store_spec.rb +++ b/spec/integration/knife/chef_fs_data_store_spec.rb @@ -107,7 +107,7 @@ describe "ChefFSDataStore tests", :workstation do /policy_groups/x.json /roles/ /roles/x.json -EOM + EOM end end @@ -193,7 +193,7 @@ EOM knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed stderr: <<~EOM Uploading x [1.0.0] Uploaded 1 cookbook. -EOM + EOM knife("list --local -Rfp /cookbooks").should_succeed "/cookbooks/x/\n/cookbooks/x/metadata.rb\n" end @@ -225,7 +225,7 @@ EOM "name": "x", "description": "hi there" } -EOM + EOM end end end @@ -250,7 +250,7 @@ EOM knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed stderr: <<~EOM Uploading z [1.0.0] Uploaded 1 cookbook. -EOM + EOM knife("list --local -Rfp /cookbooks").should_succeed "/cookbooks/z/\n/cookbooks/z/metadata.rb\n" end @@ -288,7 +288,7 @@ EOM "name": "x", "description": "hi there" } -EOM + EOM end end @@ -321,7 +321,7 @@ EOM /policies/ /policy_groups/ /roles/ -EOM + EOM end context "DELETE /TYPE/NAME" do @@ -459,7 +459,7 @@ EOM /roles/x.json /users/ /users/x.json -EOM + EOM end end @@ -496,7 +496,7 @@ EOM "name": "x", "description": "hi there" } -EOM + EOM end end end @@ -527,7 +527,7 @@ EOM /nodes/ /roles/ /users/ -EOM + EOM end context "DELETE /TYPE/NAME" do diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb index 9df0b9def9..4a133b0181 100644 --- a/spec/integration/knife/chef_repo_path_spec.rb +++ b/spec/integration/knife/chef_repo_path_spec.rb @@ -76,7 +76,7 @@ describe "chef_repo_path tests", :workstation do /roles/role3.json /users/ /users/user3.json -EOM + EOM end it "knife list --local -Rfp --chef-repo-path chef_r~1 / grabs chef_repo2 stuff", :windows_only do @@ -98,7 +98,7 @@ EOM /roles/role3.json /users/ /users/user3.json -EOM + EOM end it "knife list --local -Rfp --chef-repo-path chef_r~1 / grabs chef_repo2 stuff", :windows_only do @@ -145,7 +145,7 @@ EOM /policy_groups/ /roles/ /roles/role3.json -EOM + EOM end context "when all _paths are set to alternates" do @@ -174,7 +174,7 @@ EOM /roles/role3.json /users/ /users/user3.json -EOM + EOM end context "when cwd is at the top level" do @@ -211,7 +211,7 @@ EOM roles/role2.json users/ users/user2.json -EOM + EOM end end @@ -221,7 +221,7 @@ EOM knife("list --local -Rfp").should_succeed <<~EOM bag2/ bag2/item2.json -EOM + EOM end it "knife list --local -Rfp ../roles lists roles" do knife("list --local -Rfp ../roles").should_succeed "/roles/role2.json\n" @@ -256,7 +256,7 @@ EOM roles/role2.json users/ users/user2.json -EOM + EOM end end @@ -280,7 +280,7 @@ EOM knife("list --local -Rfp").should_succeed <<~EOM bag2/ bag2/item2.json -EOM + EOM end end end @@ -327,7 +327,7 @@ EOM roles/role3.json users/ users/user3.json -EOM + EOM end end @@ -337,7 +337,7 @@ EOM knife("list --local -Rfp").should_succeed <<~EOM bag3/ bag3/item3.json -EOM + EOM end end end @@ -364,7 +364,7 @@ EOM { } -EOM + EOM end end @@ -381,7 +381,7 @@ EOM /cookbooks/cookbook1/metadata.rb /cookbooks/cookbook2/ /cookbooks/cookbook2/metadata.rb -EOM + EOM end end @@ -398,7 +398,7 @@ EOM /cookbooks/cookbook1/metadata.rb /cookbooks/cookbook2/ /cookbooks/cookbook2/metadata.rb -EOM + EOM end end @@ -415,7 +415,7 @@ EOM /cookbooks/cookbook1/metadata.rb /cookbooks/cookbook2/ /cookbooks/cookbook2/metadata.rb -EOM + EOM end end @@ -432,7 +432,7 @@ EOM /data_bags/bag2/item2.json /data_bags/blah/ /data_bags/blah/item.json -EOM + EOM end end @@ -449,7 +449,7 @@ EOM /data_bags/bag2/item2.json /data_bags/blah/ /data_bags/blah/item1.json -EOM + EOM end end @@ -464,7 +464,7 @@ EOM { } -EOM + EOM end end @@ -479,7 +479,7 @@ EOM { } -EOM + EOM end end @@ -494,7 +494,7 @@ EOM { } -EOM + EOM end end @@ -509,7 +509,7 @@ EOM { } -EOM + EOM end end @@ -528,7 +528,7 @@ EOM bag/item.json bag2/ bag2/item2.json -EOM + EOM end end @@ -561,7 +561,7 @@ EOM users/ users/user1.json users/user2.json -EOM + EOM end end @@ -573,7 +573,7 @@ EOM bag/item.json bag2/ bag2/item2.json -EOM + EOM end end end @@ -618,7 +618,7 @@ EOM users/ users/user1.json users/user3.json -EOM + EOM end end @@ -630,7 +630,7 @@ EOM bag/item.json bag3/ bag3/item3.json -EOM + EOM end end @@ -663,7 +663,7 @@ EOM users/ users/user1.json users/user3.json -EOM + EOM end end @@ -675,7 +675,7 @@ EOM bag/item.json bag3/ bag3/item3.json -EOM + EOM end end end @@ -723,7 +723,7 @@ EOM roles/role3.json users/ users/user3.json -EOM + EOM end end @@ -733,7 +733,7 @@ EOM knife("list --local -Rfp").should_succeed <<~EOM bag3/ bag3/item3.json -EOM + EOM end end end @@ -779,7 +779,7 @@ EOM users/ users/user1.json users/user3.json -EOM + EOM end end @@ -791,7 +791,7 @@ EOM bag/item.json bag3/ bag3/item3.json -EOM + EOM end end @@ -824,7 +824,7 @@ EOM users/ users/user1.json users/user3.json -EOM + EOM end end @@ -836,7 +836,7 @@ EOM bag/item.json bag3/ bag3/item3.json -EOM + EOM end end end @@ -863,7 +863,7 @@ EOM knife("list --local -Rfp").should_succeed <<~EOM bag/ bag/item.json -EOM + EOM end end @@ -887,7 +887,7 @@ EOM roles/role3.json users/ users/user3.json -EOM + EOM end end @@ -915,14 +915,14 @@ EOM /data_bags/ /data_bags/bag/ /data_bags/bag/item.json -EOM + EOM end it "knife list --local -Rfp /data_bags lists data bags" do knife("list --local -Rfp /data_bags").should_succeed <<~EOM /data_bags/bag/ /data_bags/bag/item.json -EOM + EOM end context "when cwd is inside the data_bags directory" do @@ -931,7 +931,7 @@ EOM knife("list --local -Rfp").should_succeed <<~EOM bag/ bag/item.json -EOM + EOM end end end diff --git a/spec/integration/knife/chef_repository_file_system_spec.rb b/spec/integration/knife/chef_repository_file_system_spec.rb index 538d6c5a63..6e9c4611e2 100644 --- a/spec/integration/knife/chef_repository_file_system_spec.rb +++ b/spec/integration/knife/chef_repository_file_system_spec.rb @@ -37,7 +37,7 @@ describe "General chef_repo file system checks", :workstation do /data_bags/bag1/ /environments/ /roles/ -EOM + EOM end end @@ -55,7 +55,7 @@ EOM it "knife list --local -Rfp / does not return it" do knife("list --local -Rfp /").should_succeed(<<~EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ -EOM + EOM end end @@ -65,7 +65,7 @@ EOM it "knife list --local -Rfp / does not return it" do knife("list --local -Rfp /").should_succeed(<<~EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ -EOM + EOM end end @@ -82,7 +82,7 @@ EOM /cookbooks/cookbook1/templates/ /cookbooks/cookbook1/templates/default/ /cookbooks/cookbook1/templates/default/x.txt -EOM + EOM end end @@ -92,7 +92,7 @@ EOM it "knife list --local -Rfp / does not return it" do knife("list --local -Rfp /").should_succeed(<<~EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ -EOM + EOM end end @@ -110,7 +110,7 @@ EOM /cookbooks/cookbook1/templates/ /cookbooks/cookbook1/templates/default/ /cookbooks/cookbook1/templates/default/x.txt -EOM + EOM end end @@ -154,7 +154,7 @@ EOM /environments/environment1.json /roles/ /roles/role1.json -EOM + EOM end end @@ -163,7 +163,7 @@ EOM it "does not show up in list -Rfp" do knife("list --local -Rfp /").should_succeed <<~EOM /cookbooks/ -EOM + EOM end end @@ -172,7 +172,7 @@ EOM it "does not show up in list -Rfp" do knife("list --local -Rfp /").should_succeed <<~EOM /data_bags/ -EOM + EOM end end end diff --git a/spec/integration/knife/chefignore_spec.rb b/spec/integration/knife/chefignore_spec.rb index eb36f4675f..b92fb1f485 100644 --- a/spec/integration/knife/chefignore_spec.rb +++ b/spec/integration/knife/chefignore_spec.rb @@ -56,7 +56,7 @@ describe "chefignore tests", :workstation do /environments/x.json /roles/ /roles/x.json -EOM + EOM end end end @@ -71,7 +71,7 @@ EOM it "the cookbook is not listed" do knife("list --local -Rfp /").should_succeed(<<~EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n") /cookbooks/ -EOM + EOM end end @@ -93,7 +93,7 @@ EOM /cookbooks/cookbook1/y.json /cookbooks/cookbook2/ /cookbooks/cookbook2/y.json -EOM + EOM end end @@ -110,7 +110,7 @@ EOM /cookbooks/cookbook1/y.json /cookbooks/cookbook2/ /cookbooks/cookbook2/y.json -EOM + EOM end end @@ -132,7 +132,7 @@ EOM /cookbooks/cookbook2/recipes/y.rb /cookbooks/cookbook2/x.json /cookbooks/cookbook2/y.json -EOM + EOM end end @@ -153,7 +153,7 @@ EOM /cookbooks/cookbook2/ /cookbooks/cookbook2/x.json /cookbooks/cookbook2/y.json -EOM + EOM end end @@ -173,7 +173,7 @@ EOM /cookbooks/cookbook2/ /cookbooks/cookbook2/x.json /cookbooks/cookbook2/y.json -EOM + EOM end end @@ -191,7 +191,7 @@ EOM /cookbooks/cookbook2/ /cookbooks/cookbook2/x.json /cookbooks/cookbook2/y.json -EOM + EOM end end @@ -207,7 +207,7 @@ EOM /cookbooks/cookbook1/y.json /cookbooks/cookbook2/ /cookbooks/cookbook2/y.json -EOM + EOM end end end @@ -239,7 +239,7 @@ EOM /cookbooks/mycookbook/x.json /cookbooks/yourcookbook/ /cookbooks/yourcookbook/metadata.rb -EOM + EOM end context "and conflicting cookbooks" do @@ -258,7 +258,7 @@ EOM /cookbooks/yourcookbook/ /cookbooks/yourcookbook/onlyincookbooks1.rb /cookbooks/yourcookbook/x.json -EOM + EOM end end end @@ -272,7 +272,7 @@ EOM knife("list --local -Rfp /cookbooks").should_succeed <<~EOM /cookbooks/chefignore/ /cookbooks/chefignore/metadata.rb -EOM + EOM end end @@ -294,7 +294,7 @@ EOM /cookbooks/blah/metadata.rb /cookbooks/chefignore/ /cookbooks/chefignore/metadata.rb -EOM + EOM end end end diff --git a/spec/integration/knife/client_bulk_delete_spec.rb b/spec/integration/knife/client_bulk_delete_spec.rb index 42bfe0396a..73dd1680b2 100644 --- a/spec/integration/knife/client_bulk_delete_spec.rb +++ b/spec/integration/knife/client_bulk_delete_spec.rb @@ -40,7 +40,7 @@ describe "knife client bulk delete", :workstation do Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat -EOM + EOM knife("client list").should_succeed <<~EOM cdr @@ -48,7 +48,7 @@ EOM chef-webui concat cons -EOM + EOM end it "deletes all matching clients when unanchored" do @@ -60,14 +60,14 @@ EOM Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat Deleted client concat -EOM + EOM knife("client list").should_succeed <<~EOM cdr chef-validator chef-webui cons -EOM + EOM end end @@ -93,7 +93,7 @@ EOM Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat -EOM + EOM knife("client list").should_succeed <<~EOM car-validator @@ -101,7 +101,7 @@ EOM chef-validator chef-webui cons -EOM + EOM end it "deletes a validator when told to" do @@ -117,14 +117,14 @@ EOM Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat -EOM + EOM knife("client list").should_succeed <<~EOM cdr chef-validator chef-webui cons -EOM + EOM end end end diff --git a/spec/integration/knife/client_create_spec.rb b/spec/integration/knife/client_create_spec.rb index 86609a63cd..505358923b 100644 --- a/spec/integration/knife/client_create_spec.rb +++ b/spec/integration/knife/client_create_spec.rb @@ -38,7 +38,7 @@ describe "knife client create", :workstation do chef_type: client name: bah validator: true -EOM + EOM end it "refuses to add an existing client" do diff --git a/spec/integration/knife/client_delete_spec.rb b/spec/integration/knife/client_delete_spec.rb index 914827cb46..3ba51fca96 100644 --- a/spec/integration/knife/client_delete_spec.rb +++ b/spec/integration/knife/client_delete_spec.rb @@ -35,7 +35,7 @@ describe "knife client delete", :workstation do it "deletes a client" do knife("client delete car", input: "Y").should_succeed <<~EOM Do you really want to delete car? (Y/N) Deleted client[car] -EOM + EOM knife("client list").should_succeed <<~EOM car-validator @@ -44,19 +44,19 @@ EOM chef-validator chef-webui cons -EOM + EOM end it "refuses to delete a validator normally" do knife("client delete car-validator", input: "Y").should_fail exit_code: 2, stdout: "Do you really want to delete car-validator? (Y/N) ", stderr: <<~EOM FATAL: You must specify --delete-validators to delete the validator client car-validator -EOM + EOM end it "deletes a validator correctly" do knife("client delete car-validator -D", input: "Y").should_succeed <<~EOM Do you really want to delete car-validator? (Y/N) Deleted client[car-validator] -EOM + EOM end end diff --git a/spec/integration/knife/client_key_delete_spec.rb b/spec/integration/knife/client_key_delete_spec.rb index 061a3fea76..04826bb0b8 100644 --- a/spec/integration/knife/client_key_delete_spec.rb +++ b/spec/integration/knife/client_key_delete_spec.rb @@ -33,7 +33,7 @@ describe "knife client key delete", :workstation do knife("client key create -k new car") knife("client key delete car new", input: "Y").should_succeed stdout: out, stderr: <<~EOM Deleted key named new for the client named car -EOM + EOM knife("client key list car").should_succeed "" end diff --git a/spec/integration/knife/client_key_list_spec.rb b/spec/integration/knife/client_key_list_spec.rb index 0969d5fb98..4fd18a6cd5 100644 --- a/spec/integration/knife/client_key_list_spec.rb +++ b/spec/integration/knife/client_key_list_spec.rb @@ -45,7 +45,7 @@ describe "knife client key list", :workstation do expired: http://127.0.0.1:8900/clients/cons/keys/expired (expired) new: http://127.0.0.1:8900/clients/cons/keys/new next_month: http://127.0.0.1:8900/clients/cons/keys/next_month -EOM + EOM end it "lists the expired keys for a client" do diff --git a/spec/integration/knife/client_list_spec.rb b/spec/integration/knife/client_list_spec.rb index 41cf8dcbb6..27ceecf7de 100644 --- a/spec/integration/knife/client_list_spec.rb +++ b/spec/integration/knife/client_list_spec.rb @@ -41,7 +41,7 @@ describe "knife client list", :workstation do chef-validator chef-webui cons -EOM + EOM end end diff --git a/spec/integration/knife/common_options_spec.rb b/spec/integration/knife/common_options_spec.rb index e0622eb801..5eac571a85 100644 --- a/spec/integration/knife/common_options_spec.rb +++ b/spec/integration/knife/common_options_spec.rb @@ -95,7 +95,7 @@ describe "knife common options", :workstation do syHLXYFNy0OxMtH/bBAXBGNHd9gf5uOnqh0pYcbe/uRAxumC7Rl0cL509eURiA2T +vFmf54y9YdnLXaqv+FhJT6B6V7WX7IpU9BMqJY1cJYXHuHG2KA= -----END RSA PRIVATE KEY----- -EOM + EOM end it "knife raw /nodes/x should retrieve the node" do diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb index 8c2b0208ae..a7e3709276 100644 --- a/spec/integration/knife/cookbook_api_ipv6_spec.rb +++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb @@ -54,7 +54,7 @@ describe "Knife cookbook API integration with IPv6", :workstation, :not_supporte syHLXYFNy0OxMtH/bBAXBGNHd9gf5uOnqh0pYcbe/uRAxumC7Rl0cL509eURiA2T +vFmf54y9YdnLXaqv+FhJT6B6V7WX7IpU9BMqJY1cJYXHuHG2KA= -----END RSA PRIVATE KEY----- -END_VALIDATION_PEM + END_VALIDATION_PEM end let(:cache_path) do @@ -80,7 +80,7 @@ END_VALIDATION_PEM client_key '#{path_to('config/knifeuser.pem')}' node_name 'whoisthisis' cookbook_path '#{CHEF_SPEC_DATA}/cookbooks' -END_CLIENT_RB + END_CLIENT_RB end before do diff --git a/spec/integration/knife/cookbook_bulk_delete_spec.rb b/spec/integration/knife/cookbook_bulk_delete_spec.rb index d3180c788f..5b8dc3a952 100644 --- a/spec/integration/knife/cookbook_bulk_delete_spec.rb +++ b/spec/integration/knife/cookbook_bulk_delete_spec.rb @@ -42,21 +42,21 @@ describe "knife cookbook bulk delete", :workstation do foo fox Do you really want to delete these cookbooks? (Y/N) -EOM + EOM stderr = <<~EOM Deleted cookbook foo [1.0.0] Deleted cookbook foo [0.6.5] Deleted cookbook fox [0.6.5] Deleted cookbook fox [0.6.0] -EOM + EOM knife("cookbook bulk delete ^fo.*", input: "Y").should_succeed(stderr: stderr, stdout: stdout) knife("cookbook list -a").should_succeed <<~EOM fax 0.6.0 zfa 0.6.5 -EOM + EOM end # rubocop:enable Layout/TrailingWhitespace diff --git a/spec/integration/knife/cookbook_download_spec.rb b/spec/integration/knife/cookbook_download_spec.rb index 2dbf9e5ae5..3fe801b64c 100644 --- a/spec/integration/knife/cookbook_download_spec.rb +++ b/spec/integration/knife/cookbook_download_spec.rb @@ -37,7 +37,7 @@ describe "knife cookbook download", :workstation do Downloading x cookbook version 1.0.1 Downloading root_files Cookbook downloaded to #{tmpdir}/x-1.0.1 -EOM + EOM end it "knife cookbook download with a version downloads the specified version" do @@ -45,7 +45,7 @@ EOM Downloading x cookbook version 1.0.1 Downloading root_files Cookbook downloaded to #{tmpdir}/x-1.0.1 -EOM + EOM end it "knife cookbook download with an unknown version raises an error" do @@ -64,7 +64,7 @@ EOM Downloading x cookbook version 1.0.1 Downloading root_files Cookbook downloaded to #{tmpdir}/x-1.0.1 -EOM + EOM ) end end diff --git a/spec/integration/knife/cookbook_list_spec.rb b/spec/integration/knife/cookbook_list_spec.rb index afea745bce..c9e4069a44 100644 --- a/spec/integration/knife/cookbook_list_spec.rb +++ b/spec/integration/knife/cookbook_list_spec.rb @@ -39,7 +39,7 @@ describe "knife cookbook list", :workstation do x 1.0.0 y 0.6.5 z 0.6.5 -EOM + EOM end it "knife cookbook list -a shows all the versions of all the cookbooks" do @@ -47,7 +47,7 @@ EOM x 1.0.0 0.6.5 0.6.0 y 0.6.5 0.6.0 z 0.6.5 -EOM + EOM end end diff --git a/spec/integration/knife/cookbook_show_spec.rb b/spec/integration/knife/cookbook_show_spec.rb index a8e87204e4..7b894efe30 100644 --- a/spec/integration/knife/cookbook_show_spec.rb +++ b/spec/integration/knife/cookbook_show_spec.rb @@ -82,7 +82,7 @@ describe "knife cookbook show", :workstation do specificity: default url: http://127.0.0.1:8900/file_store/checksums/8226671f751ba102dea6a6b6bd32fa8d version: 1.0.0 -EOM + EOM end it "knife cookbook show x 1.0.0 metadata shows the metadata" do @@ -109,7 +109,7 @@ EOM x::x: source_url: version: 1.0.0 -EOM + EOM end it "knife cookbook show x 1.0.0 recipes shows all the recipes" do @@ -125,7 +125,7 @@ EOM path: recipes/x.rb specificity: default url: http://127.0.0.1:8900/file_store/checksums/d41d8cd98f00b204e9800998ecf8427e -EOM + EOM end # rubocop:enable Layout/TrailingWhitespace diff --git a/spec/integration/knife/cookbook_upload_spec.rb b/spec/integration/knife/cookbook_upload_spec.rb index e96884e786..7e98b6ea64 100644 --- a/spec/integration/knife/cookbook_upload_spec.rb +++ b/spec/integration/knife/cookbook_upload_spec.rb @@ -36,14 +36,14 @@ describe "knife cookbook upload", :workstation do knife("cookbook upload x -o #{cb_dir}").should_succeed stderr: <<~EOM Uploading x [1.0.0] Uploaded 1 cookbook. -EOM + EOM end it "knife cookbook upload --freeze uploads and freezes the cookbook" do knife("cookbook upload x -o #{cb_dir} --freeze").should_succeed stderr: <<~EOM Uploading x [1.0.0] Uploaded 1 cookbook. -EOM + EOM # Modify the file, attempt to reupload file "cookbooks/x/metadata.rb", 'name "x"; version "1.0.0"#different' knife("cookbook upload x -o #{cb_dir} --freeze").should_fail stderr: <<~EOM @@ -51,7 +51,7 @@ EOM ERROR: Version 1.0.0 of cookbook x is frozen. Use --force to override. WARNING: Not updating version constraints for x in the environment as the cookbook is frozen. ERROR: Failed to upload 1 cookbook. -EOM + EOM end end @@ -66,7 +66,7 @@ EOM Uploading x [1.0.0] Uploading y [1.0.0] Uploaded 2 cookbooks. -EOM + EOM end it "knife cookbook upload fails due to missing dependencies" do @@ -75,7 +75,7 @@ EOM ERROR: Cookbook x depends on cookbooks which are not currently ERROR: being uploaded and cannot be found on the server. ERROR: The missing cookbook(s) are: 'y' version '>= 0.0.0' -EOM + EOM end it "knife cookbook upload -a uploads both cookbooks" do @@ -83,7 +83,7 @@ EOM Uploading x [1.0.0] Uploading y [1.0.0] Uploaded all cookbooks. -EOM + EOM end end end diff --git a/spec/integration/knife/data_bag_delete_spec.rb b/spec/integration/knife/data_bag_delete_spec.rb index f0ca05a3e4..b5ee1b0422 100644 --- a/spec/integration/knife/data_bag_delete_spec.rb +++ b/spec/integration/knife/data_bag_delete_spec.rb @@ -34,25 +34,25 @@ describe "knife data bag delete", :workstation do it "with an empty data bag" do knife("data bag delete canteloupe", input: "y").should_succeed <<~EOM Do you really want to delete canteloupe? (Y/N) Deleted data_bag[canteloupe] -EOM + EOM end it "with a bag with some items" do knife("data bag delete rocket", input: "y").should_succeed <<~EOM Do you really want to delete rocket? (Y/N) Deleted data_bag[rocket] -EOM + EOM end it "with a single item" do knife("data bag delete rocket falcon9", input: "y").should_succeed <<~EOM Do you really want to delete falcon9? (Y/N) Deleted data_bag_item[falcon9] -EOM + EOM end it "choosing not to delete" do knife("data bag delete rocket falcon9", input: "n").should_succeed <<~EOM, exit_code: 3 Do you really want to delete falcon9? (Y/N) You said no, so I'm done here. -EOM + EOM end end end diff --git a/spec/integration/knife/data_bag_from_file_spec.rb b/spec/integration/knife/data_bag_from_file_spec.rb index afaafc1e6b..5083153e91 100644 --- a/spec/integration/knife/data_bag_from_file_spec.rb +++ b/spec/integration/knife/data_bag_from_file_spec.rb @@ -47,7 +47,7 @@ describe "knife data bag from file", :workstation do "cipher": "aes-256-cbc" } } -EOM + EOM file "data_bags/bar/round_trip.json", <<~EOM { "name": "data_bag_item_bar_round_trip", @@ -70,33 +70,33 @@ EOM } } } -EOM + EOM end it "uploads a single file" do knife("data bag from file foo #{db_dir}/foo/bar.json").should_succeed stderr: <<~EOM Updated data_bag_item[foo::bar] -EOM + EOM end it "uploads a single encrypted file" do knife("data bag from file foo #{db_dir}/foo/encrypted.json").should_succeed stderr: <<~EOM Updated data_bag_item[foo::encrypted] -EOM + EOM end it "uploads a file in chef's internal format" do pending "chef/chef#4815" knife("data bag from file bar #{db_dir}/bar/round_trip.json").should_succeed stderr: <<~EOM Updated data_bag_item[bar::round_trip] -EOM + EOM end it "uploads many files" do knife("data bag from file foo #{db_dir}/foo/bar.json #{db_dir}/foo/bzr.json").should_succeed stderr: <<~EOM Updated data_bag_item[foo::bar] Updated data_bag_item[foo::bzr] -EOM + EOM end it "uploads a whole directory" do @@ -107,7 +107,7 @@ EOM cat dog encrypted -EOM + EOM end end diff --git a/spec/integration/knife/data_bag_list_spec.rb b/spec/integration/knife/data_bag_list_spec.rb index 4a2b740937..2e57cc7cca 100644 --- a/spec/integration/knife/data_bag_list_spec.rb +++ b/spec/integration/knife/data_bag_list_spec.rb @@ -36,7 +36,7 @@ describe "knife data bag list", :workstation do canteloupe rocket x -EOM + EOM end end diff --git a/spec/integration/knife/data_bag_show_spec.rb b/spec/integration/knife/data_bag_show_spec.rb index 5fefec5266..7e1a6b6e32 100644 --- a/spec/integration/knife/data_bag_show_spec.rb +++ b/spec/integration/knife/data_bag_show_spec.rb @@ -40,14 +40,14 @@ describe "knife data bag show", :workstation do ariane atlas falcon9 -EOM + EOM end it "with a single item" do knife("data bag show rocket falcon9").should_succeed <<~EOM heavy: true id: falcon9 -EOM + EOM end end end diff --git a/spec/integration/knife/delete_spec.rb b/spec/integration/knife/delete_spec.rb index 2e3efcf693..fd5853dfef 100644 --- a/spec/integration/knife/delete_spec.rb +++ b/spec/integration/knife/delete_spec.rb @@ -43,7 +43,7 @@ describe "knife delete", :workstation do /roles/x.json /users /users/x.json -EOM + EOM end let :server_everything do @@ -68,7 +68,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM end let :server_nothing do <<~EOM @@ -83,7 +83,7 @@ EOM /roles /users /users/admin.json -EOM + EOM end let :nothing do @@ -95,7 +95,7 @@ EOM /nodes /roles /users -EOM + EOM end when_the_chef_server "has one of each thing" do @@ -125,7 +125,7 @@ EOM knife("delete --both /cookbooks/x").should_fail <<~EOM ERROR: /cookbooks/x (remote) must be deleted recursively! Pass -r to knife delete. ERROR: /cookbooks/x (local) must be deleted recursively! Pass -r to knife delete. -EOM + EOM knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed everything end @@ -151,7 +151,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM /clients /clients/x.json @@ -168,7 +168,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete -r --local /cookbooks/x deletes x locally but not remotely" do @@ -190,7 +190,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete -r /cookbooks/x deletes x remotely but not locally" do @@ -214,7 +214,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed everything end @@ -229,7 +229,7 @@ EOM knife("delete --both /data_bags/empty").should_fail <<~EOM ERROR: /data_bags/empty (remote) must be deleted recursively! Pass -r to knife delete. ERROR: /data_bags/empty (local) must be deleted recursively! Pass -r to knife delete. -EOM + EOM knife("list -Rf /").should_succeed <<~EOM /clients /clients/chef-validator.json @@ -252,7 +252,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM /clients /clients/x.json @@ -272,7 +272,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end end @@ -280,7 +280,7 @@ EOM knife("delete --both /data_bags/x").should_fail <<~EOM ERROR: /data_bags/x (remote) must be deleted recursively! Pass -r to knife delete. ERROR: /data_bags/x (local) must be deleted recursively! Pass -r to knife delete. -EOM + EOM knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed everything end @@ -306,7 +306,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM /clients /clients/x.json @@ -323,7 +323,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both /environments/x.json deletes x" do @@ -348,7 +348,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM /clients /clients/x.json @@ -366,7 +366,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both /roles/x.json deletes x" do @@ -391,7 +391,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM /clients /clients/x.json @@ -409,7 +409,7 @@ EOM /roles /users /users/x.json -EOM + EOM end it "knife delete --both /environments/_default.json fails but still deletes the local copy" do @@ -432,7 +432,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both /environments/nonexistent.json fails" do @@ -445,7 +445,7 @@ EOM knife("delete --both /").should_fail <<~EOM ERROR: / (remote) cannot be deleted. ERROR: / (local) cannot be deleted. -EOM + EOM knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed everything end @@ -468,7 +468,7 @@ EOM ERROR: /roles (local) cannot be deleted. ERROR: /users (remote) cannot be deleted. ERROR: /users (local) cannot be deleted. -EOM + EOM knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed everything end @@ -512,7 +512,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed nothing end @@ -543,7 +543,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed nothing end @@ -569,7 +569,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed nothing end @@ -595,7 +595,7 @@ EOM /users /users/admin.json /users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed nothing end @@ -629,7 +629,7 @@ EOM ERROR: /roles (local) cannot be deleted. ERROR: /users (remote) cannot be deleted. ERROR: /users (local) cannot be deleted. -EOM + EOM knife("list -Rf /").should_succeed server_everything knife("list -Rf --local /").should_succeed nothing end @@ -665,7 +665,7 @@ EOM users users/admin.json users/x.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM clients cookbooks @@ -674,7 +674,7 @@ EOM nodes roles users -EOM + EOM end end end @@ -718,7 +718,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both /data_bags/x fails" do @@ -746,7 +746,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both /environments/x.json deletes x" do @@ -769,7 +769,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both /roles/x.json deletes x" do @@ -792,7 +792,7 @@ EOM /roles /users /users/x.json -EOM + EOM end it "knife delete --both /environments/_default.json fails but still deletes the local copy" do @@ -815,7 +815,7 @@ EOM /roles/x.json /users /users/x.json -EOM + EOM end it "knife delete --both / fails" do @@ -842,7 +842,7 @@ EOM ERROR: /roles (local) cannot be deleted. ERROR: /users (remote) cannot be deleted. ERROR: /users (local) cannot be deleted. -EOM + EOM knife("list -Rf /").should_succeed server_nothing knife("list -Rf --local /").should_succeed everything end @@ -869,7 +869,7 @@ EOM roles users users/admin.json -EOM + EOM knife("list -Rf --local /").should_succeed <<~EOM clients clients/x.json @@ -888,7 +888,7 @@ EOM roles/x.json users users/x.json -EOM + EOM end end end diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb index b7eafcbd1c..4dfccf38de 100644 --- a/spec/integration/knife/deps_spec.rb +++ b/spec/integration/knife/deps_spec.rb @@ -46,7 +46,7 @@ describe "knife deps", :workstation do /cookbooks/quiche /cookbooks/soup /roles/starring.json -EOM + EOM end end @@ -65,7 +65,7 @@ EOM /cookbooks/quiche /cookbooks/soup /roles/starring.json -EOM + EOM end end @@ -99,7 +99,7 @@ EOM /cookbooks/quiche /cookbooks/soup /nodes/mort.json -EOM + EOM end end when_the_repository "has a cookbook with no dependencies" do @@ -155,7 +155,7 @@ depends "kettle"' /cookbooks/soup /roles/starring.json /nodes/mort.json -EOM + EOM end it "knife deps * reports all dependencies of all things" do knife("deps /nodes/*").should_succeed <<~EOM @@ -166,7 +166,7 @@ EOM /cookbooks/soup /roles/starring.json /nodes/mort.json -EOM + EOM end it "knife deps a b reports all dependencies of a and b" do knife("deps /nodes/bart.json /nodes/mort.json").should_succeed <<~EOM @@ -177,7 +177,7 @@ EOM /cookbooks/soup /roles/starring.json /nodes/mort.json -EOM + EOM end it "knife deps --tree /* shows dependencies in a tree" do knife("deps --tree /nodes/*").should_succeed <<~EOM @@ -189,7 +189,7 @@ EOM /roles/minor.json /cookbooks/quiche /cookbooks/soup -EOM + EOM end it "knife deps --tree --no-recurse shows only the first level of dependencies" do knife("deps --tree --no-recurse /nodes/*").should_succeed <<~EOM @@ -198,7 +198,7 @@ EOM /nodes/mort.json /environments/desert.json /roles/starring.json -EOM + EOM end end @@ -237,7 +237,7 @@ depends "foo"' /roles/bar.json /roles/foo.json /roles/self.json -EOM + EOM end it "knife deps --tree prints each once" do knife("deps --tree /roles/foo.json /roles/self.json") do @@ -383,7 +383,7 @@ EOM /cookbooks/quiche /cookbooks/soup /roles/starring.json -EOM + EOM end end @@ -400,7 +400,7 @@ EOM /cookbooks/quiche /cookbooks/soup /roles/starring.json -EOM + EOM end end @@ -432,7 +432,7 @@ EOM /cookbooks/quiche /cookbooks/soup /nodes/mort.json -EOM + EOM end end when_the_chef_server "has a cookbook with no dependencies" do @@ -484,7 +484,7 @@ depends "kettle"', "recipes" => { "default.rb" => "" } } /cookbooks/soup /roles/starring.json /nodes/mort.json -EOM + EOM end it "knife deps * reports all dependencies of all things" do knife("deps --remote /nodes/*").should_succeed <<~EOM @@ -495,7 +495,7 @@ EOM /cookbooks/soup /roles/starring.json /nodes/mort.json -EOM + EOM end it "knife deps a b reports all dependencies of a and b" do knife("deps --remote /nodes/bart.json /nodes/mort.json").should_succeed <<~EOM @@ -506,7 +506,7 @@ EOM /cookbooks/soup /roles/starring.json /nodes/mort.json -EOM + EOM end it "knife deps --tree /* shows dependencies in a tree" do knife("deps --remote --tree /nodes/*").should_succeed <<~EOM @@ -518,7 +518,7 @@ EOM /roles/minor.json /cookbooks/quiche /cookbooks/soup -EOM + EOM end it "knife deps --tree --no-recurse shows only the first level of dependencies" do knife("deps --remote --tree --no-recurse /nodes/*").should_succeed <<~EOM @@ -527,18 +527,18 @@ EOM /nodes/mort.json /environments/desert.json /roles/starring.json -EOM + EOM end end context "circular dependencies" do when_the_chef_server "has cookbooks with circular dependencies" do before do - cookbook "foo", "1.0.0", { "metadata.rb" => 'name "foo" + cookbook "foo", "1.0.0", { "metadata.rb" => 'name "foo" depends "bar"' } - cookbook "bar", "1.0.0", { "metadata.rb" => 'name "bar" + cookbook "bar", "1.0.0", { "metadata.rb" => 'name "bar" depends "baz"' } - cookbook "baz", "1.0.0", { "metadata.rb" => 'name "baz" + cookbook "baz", "1.0.0", { "metadata.rb" => 'name "baz" depends "foo"' } cookbook "self", "1.0.0", { "metadata.rb" => 'name "self" depends "self"' } @@ -549,7 +549,7 @@ depends "self"' } /cookbooks/bar /cookbooks/foo /cookbooks/self -EOM + EOM end it "knife deps --tree prints each once" do knife("deps --remote --tree /cookbooks/foo /cookbooks/self").should_succeed <<~EOM @@ -559,7 +559,7 @@ EOM /cookbooks/foo /cookbooks/self /cookbooks/self -EOM + EOM end end when_the_chef_server "has roles with circular dependencies" do @@ -575,7 +575,7 @@ EOM /roles/bar.json /roles/foo.json /roles/self.json -EOM + EOM end it "knife deps --tree prints each once" do knife("deps --remote --tree /roles/foo.json /roles/self.json") do diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb index 9e54558300..719e9f59e6 100644 --- a/spec/integration/knife/diff_spec.rb +++ b/spec/integration/knife/diff_spec.rb @@ -58,7 +58,7 @@ describe "knife diff", :workstation do D\t/roles/x.json D\t/users/admin.json D\t/users/x.json -EOM + EOM end end @@ -96,13 +96,13 @@ EOM { "foo": "bar" } -EOM + EOM end it "knife diff reports the role as different" do knife("diff --name-status /").should_succeed <<~EOM M\t/roles/x.json -EOM + EOM end end @@ -130,7 +130,7 @@ EOM A\t/nodes/y.json A\t/roles/y.json A\t/users/y.json -EOM + EOM end context "when cwd is the data_bags directory" do @@ -139,13 +139,13 @@ EOM knife("diff --name-status").should_succeed <<~EOM A\tx/z.json A\ty -EOM + EOM end it "knife diff * reports different data bags" do knife("diff --name-status *").should_succeed <<~EOM A\tx/z.json A\ty -EOM + EOM end end end @@ -161,7 +161,7 @@ EOM D\t/nodes D\t/roles D\t/users -EOM + EOM end end end @@ -183,14 +183,14 @@ EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM end it "knife diff --diff-filter=MAT does not show deleted files" do knife("diff --diff-filter=MAT --name-status /cookbooks/x").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM end end @@ -214,7 +214,7 @@ EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM end end @@ -228,7 +228,7 @@ EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin0.9.9.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM end end end @@ -353,7 +353,7 @@ EOM D\t/roles/x.json D\t/users/admin.json D\t/users/x.json -EOM + EOM end end @@ -390,13 +390,13 @@ EOM { "foo": "bar" } -EOM + EOM end it "knife diff reports the role as different" do knife("diff --name-status /").should_succeed <<~EOM M\t/roles/x.json -EOM + EOM end end @@ -426,7 +426,7 @@ EOM A\t/nodes/y.json A\t/roles/y.json A\t/users/y.json -EOM + EOM end context "when cwd is the data_bags directory" do @@ -435,13 +435,13 @@ EOM knife("diff --name-status").should_succeed <<~EOM A\tx/z.json A\ty -EOM + EOM end it "knife diff * reports different data bags" do knife("diff --name-status *").should_succeed <<~EOM A\tx/z.json A\ty -EOM + EOM end end end @@ -457,7 +457,7 @@ EOM D\t/nodes D\t/roles D\t/users -EOM + EOM end end end @@ -477,7 +477,7 @@ EOM it "knife diff /cookbooks shows differences" do knife("diff --name-status /cookbooks").should_succeed <<~EOM D\t/cookbooks/x-1.0.1 -EOM + EOM end it "knife diff --diff-filter=MAT does not show deleted files" do @@ -504,7 +504,7 @@ EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM D\t/cookbooks/x-1.0.1 A\t/cookbooks/x-1.0.0 -EOM + EOM end end @@ -517,7 +517,7 @@ EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM D\t/cookbooks/x-0.9.9 A\t/cookbooks/x-1.0.0 -EOM + EOM end end end diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index 04610ba4e7..93d804b749 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -62,7 +62,7 @@ describe "knife download", :workstation do Created /roles/x.json Created /users/admin.json Created /users/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end end @@ -110,7 +110,7 @@ EOM ] } -EOM + EOM end it "knife download changes the role" do @@ -142,7 +142,7 @@ EOM ] } -EOM + EOM end it "knife download / does not change anything" do @@ -176,7 +176,7 @@ EOM A\t/nodes/y.json A\t/roles/y.json A\t/users/y.json -EOM + EOM end it "knife download --purge deletes the extra files" do @@ -190,7 +190,7 @@ EOM Deleted extra entry /nodes/y.json (purge is on) Deleted extra entry /roles/y.json (purge is on) Deleted extra entry /users/y.json (purge is on) -EOM + EOM knife("diff --name-status /").should_succeed "" end end @@ -219,7 +219,7 @@ EOM Created /users Created /users/admin.json Created /users/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end @@ -245,7 +245,7 @@ EOM Created /users Created /users/admin.json Created /users/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end @@ -273,10 +273,10 @@ EOM Created /data_bags Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/z.json -EOM + EOM end it "knife download /data_bags/x /data_bags/x/y.json downloads x once" do @@ -285,7 +285,7 @@ EOM Created /data_bags/x Created /data_bags/x/y.json Created /data_bags/x/z.json -EOM + EOM end end end @@ -296,17 +296,17 @@ EOM { "id": "deleted" } -EOM + EOM file "data_bags/x/modified.json", <<~EOM { "id": "modified" } -EOM + EOM file "data_bags/x/unmodified.json", <<~EOM { "id": "unmodified" } -EOM + EOM end when_the_chef_server "has a modified, unmodified, added and deleted data bag item" do @@ -321,11 +321,11 @@ EOM it "knife download of the modified file succeeds" do knife("download /data_bags/x/modified.json").should_succeed <<~EOM Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/added.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download of the unmodified file does nothing" do knife("download /data_bags/x/unmodified.json").should_succeed "" @@ -333,16 +333,16 @@ EOM D\t/data_bags/x/added.json M\t/data_bags/x/modified.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download of the added file succeeds" do knife("download /data_bags/x/added.json").should_succeed <<~EOM Created /data_bags/x/added.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM M\t/data_bags/x/modified.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download of the deleted file does nothing" do knife("download /data_bags/x/deleted.json").should_succeed "" @@ -350,32 +350,32 @@ EOM D\t/data_bags/x/added.json M\t/data_bags/x/modified.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download --purge of the deleted file deletes it" do knife("download --purge /data_bags/x/deleted.json").should_succeed <<~EOM Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/added.json M\t/data_bags/x/modified.json -EOM + EOM end it "knife download of the entire data bag downloads everything" do knife("download /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download --purge of the entire data bag downloads everything" do knife("download --purge /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end context "when cwd is the /data_bags directory" do @@ -390,7 +390,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end it "knife download --purge * downloads everything" do @@ -398,7 +398,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end end @@ -421,7 +421,7 @@ EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM D\t/cookbooks/x/y.rb A\t/cookbooks/x/z.rb -EOM + EOM end it "knife download of a deleted file does nothing" do knife("download /cookbooks/x/z.rb").should_succeed "" @@ -429,37 +429,37 @@ EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/y.rb A\t/cookbooks/x/z.rb -EOM + EOM end it "knife download --purge of a deleted file succeeds" do knife("download --purge /cookbooks/x/z.rb").should_succeed "Deleted extra entry /cookbooks/x/z.rb (purge is on)\n" knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/y.rb -EOM + EOM end it "knife download of an added file succeeds" do knife("download /cookbooks/x/y.rb").should_succeed "Created /cookbooks/x/y.rb\n" knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb A\t/cookbooks/x/z.rb -EOM + EOM end it "knife download of the cookbook itself succeeds" do knife("download /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x/metadata.rb Created /cookbooks/x/y.rb -EOM + EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM A\t/cookbooks/x/z.rb -EOM + EOM end it "knife download --purge of the cookbook itself succeeds" do knife("download --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x/metadata.rb Created /cookbooks/x/y.rb Deleted extra entry /cookbooks/x/z.rb (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -482,7 +482,7 @@ EOM Updated /cookbooks/x/metadata.rb Created /cookbooks/x/onlyin1.0.1.rb Deleted extra entry /cookbooks/x/onlyin1.0.0.rb (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -496,7 +496,7 @@ EOM it "knife download /cookbooks/x downloads the updated file" do knife("download --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x/onlyin1.0.0.rb -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -511,7 +511,7 @@ EOM Updated /cookbooks/x/metadata.rb Created /cookbooks/x/onlyin1.0.1.rb Deleted extra entry /cookbooks/x/onlyin1.0.0.rb (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -526,7 +526,7 @@ EOM Updated /cookbooks/x/metadata.rb Created /cookbooks/x/onlyin0.9.9.rb Deleted extra entry /cookbooks/x/onlyin1.0.0.rb (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -541,7 +541,7 @@ EOM file "roles/x.rb", <<~EOM name "x" description "x" -EOM + EOM end it "knife download refuses to change the role" do @@ -565,7 +565,7 @@ EOM { (right here) ------^ -EOH + EOH knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", stderr: warning knife("diff --name-status /environments/x.json").should_succeed "" end @@ -631,7 +631,7 @@ EOH Created /roles/x.json Created /users/admin.json Created /users/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end end @@ -690,7 +690,7 @@ EOM ] } -EOM + EOM end it "knife download / does not change anything" do @@ -726,7 +726,7 @@ EOM A\t/nodes/y.json A\t/roles/y.json A\t/users/y.json -EOM + EOM end it "knife download --purge deletes the extra files" do @@ -741,7 +741,7 @@ EOM Deleted extra entry /nodes/y.json (purge is on) Deleted extra entry /roles/y.json (purge is on) Deleted extra entry /users/y.json (purge is on) -EOM + EOM knife("diff --name-status /").should_succeed "" end end @@ -770,7 +770,7 @@ EOM Created /users Created /users/admin.json Created /users/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end @@ -797,10 +797,10 @@ EOM Created /data_bags Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/z.json -EOM + EOM end end end @@ -811,17 +811,17 @@ EOM { "id": "deleted" } -EOM + EOM file "data_bags/x/modified.json", <<~EOM { "id": "modified" } -EOM + EOM file "data_bags/x/unmodified.json", <<~EOM { "id": "unmodified" } -EOM + EOM end when_the_chef_server "has a modified, unmodified, added and deleted data bag item" do @@ -836,11 +836,11 @@ EOM it "knife download of the modified file succeeds" do knife("download /data_bags/x/modified.json").should_succeed <<~EOM Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/added.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download of the unmodified file does nothing" do knife("download /data_bags/x/unmodified.json").should_succeed "" @@ -848,16 +848,16 @@ EOM D\t/data_bags/x/added.json M\t/data_bags/x/modified.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download of the added file succeeds" do knife("download /data_bags/x/added.json").should_succeed <<~EOM Created /data_bags/x/added.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM M\t/data_bags/x/modified.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download of the deleted file does nothing" do knife("download /data_bags/x/deleted.json").should_succeed "" @@ -865,32 +865,32 @@ EOM D\t/data_bags/x/added.json M\t/data_bags/x/modified.json A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download --purge of the deleted file deletes it" do knife("download --purge /data_bags/x/deleted.json").should_succeed <<~EOM Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/added.json M\t/data_bags/x/modified.json -EOM + EOM end it "knife download of the entire data bag downloads everything" do knife("download /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM A\t/data_bags/x/deleted.json -EOM + EOM end it "knife download --purge of the entire data bag downloads everything" do knife("download --purge /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end context "when cwd is the /data_bags directory" do @@ -905,7 +905,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end it "knife download --purge * downloads everything" do @@ -913,7 +913,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end end @@ -936,7 +936,7 @@ EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM D\t/cookbooks/x-1.0.0/y.rb A\t/cookbooks/x-1.0.0/z.rb -EOM + EOM end it "knife download of a deleted file does nothing" do knife("download /cookbooks/x-1.0.0/z.rb").should_succeed "" @@ -944,37 +944,37 @@ EOM M\t/cookbooks/x-1.0.0/metadata.rb D\t/cookbooks/x-1.0.0/y.rb A\t/cookbooks/x-1.0.0/z.rb -EOM + EOM end it "knife download --purge of a deleted file succeeds" do knife("download --purge /cookbooks/x-1.0.0/z.rb").should_succeed "Deleted extra entry /cookbooks/x-1.0.0/z.rb (purge is on)\n" knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x-1.0.0/metadata.rb D\t/cookbooks/x-1.0.0/y.rb -EOM + EOM end it "knife download of an added file succeeds" do knife("download /cookbooks/x-1.0.0/y.rb").should_succeed "Created /cookbooks/x-1.0.0/y.rb\n" knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x-1.0.0/metadata.rb A\t/cookbooks/x-1.0.0/z.rb -EOM + EOM end it "knife download of the cookbook itself succeeds" do knife("download /cookbooks/x-1.0.0").should_succeed <<~EOM Updated /cookbooks/x-1.0.0/metadata.rb Created /cookbooks/x-1.0.0/y.rb -EOM + EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM A\t/cookbooks/x-1.0.0/z.rb -EOM + EOM end it "knife download --purge of the cookbook itself succeeds" do knife("download --purge /cookbooks/x-1.0.0").should_succeed <<~EOM Updated /cookbooks/x-1.0.0/metadata.rb Created /cookbooks/x-1.0.0/y.rb Deleted extra entry /cookbooks/x-1.0.0/z.rb (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -998,7 +998,7 @@ EOM Created /cookbooks/x-1.0.1 Created /cookbooks/x-1.0.1/metadata.rb Created /cookbooks/x-1.0.1/onlyin1.0.1.rb -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1015,7 +1015,7 @@ EOM Created /cookbooks/x-0.9.9/metadata.rb Created /cookbooks/x-0.9.9/onlyin0.9.9.rb Updated /cookbooks/x-1.0.0/onlyin1.0.0.rb -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1031,7 +1031,7 @@ EOM Created /cookbooks/x-1.0.1/metadata.rb Created /cookbooks/x-1.0.1/onlyin1.0.1.rb Deleted extra entry /cookbooks/x-1.0.0 (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1047,7 +1047,7 @@ EOM Created /cookbooks/x-0.9.9/metadata.rb Created /cookbooks/x-0.9.9/onlyin0.9.9.rb Deleted extra entry /cookbooks/x-1.0.0 (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1106,7 +1106,7 @@ EOM Created /cookbooks Created /cookbooks/x Created /cookbooks/x/metadata.rb -EOM + EOM end end end @@ -1189,7 +1189,7 @@ EOM Created /policies Created /policy_groups Created /roles -EOM + EOM end context "and the server has one of each thing" do @@ -1232,7 +1232,7 @@ EOM Created /acls/roles/x.json Updated /groups/clients.json Updated /groups/users.json -EOM + EOM end it "knife download / downloads everything" do @@ -1254,7 +1254,7 @@ EOM Created /policies/x-1.0.0.json Created /policy_groups/x.json Created /roles/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end @@ -1323,7 +1323,7 @@ EOM Updated /policies/x-1.0.0.json Updated /policy_groups/x.json Updated /roles/x.json -EOM + EOM knife("diff --name-status /").should_succeed "" end end diff --git a/spec/integration/knife/environment_compare_spec.rb b/spec/integration/knife/environment_compare_spec.rb index d3999fffa3..713c1efe12 100644 --- a/spec/integration/knife/environment_compare_spec.rb +++ b/spec/integration/knife/environment_compare_spec.rb @@ -49,7 +49,7 @@ describe "knife environment compare", :workstation do blah = 1.0.0 krad >= 1.0.0 -EOM + EOM end it "compares the cookbooks for two environments" do @@ -58,7 +58,7 @@ EOM blah = 1.0.0 = 1.1.0 krad >= 1.0.0 >= 1.0.0 -EOM + EOM end it "compares the cookbooks for all environments" do @@ -67,7 +67,7 @@ EOM blah = 1.0.0 = 1.1.0 krad >= 1.0.0 >= 1.0.0 -EOM + EOM end # rubocop:enable Layout/TrailingWhitespace end diff --git a/spec/integration/knife/environment_from_file_spec.rb b/spec/integration/knife/environment_from_file_spec.rb index 8948a3772c..8b33e254d8 100644 --- a/spec/integration/knife/environment_from_file_spec.rb +++ b/spec/integration/knife/environment_from_file_spec.rb @@ -45,7 +45,7 @@ describe "knife environment from file", :workstation do } } -EOM + EOM file "environments/car.json", <<~EOM { @@ -63,7 +63,7 @@ EOM } } -EOM + EOM file "environments/cdr.json", <<~EOM { @@ -81,14 +81,14 @@ EOM } } -EOM + EOM end it "uploads a single file" do knife("environment from file #{env_dir}/cons.json").should_succeed stderr: <<~EOM Updated Environment cons -EOM + EOM end it "uploads many files" do @@ -96,7 +96,7 @@ EOM Updated Environment cons Updated Environment car Updated Environment cdr -EOM + EOM end it "uploads all environments in the repository" do @@ -107,7 +107,7 @@ EOM car cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/environment_list_spec.rb b/spec/integration/knife/environment_list_spec.rb index 0ac2df6300..b6b25e8661 100644 --- a/spec/integration/knife/environment_list_spec.rb +++ b/spec/integration/knife/environment_list_spec.rb @@ -34,7 +34,7 @@ describe "knife environment list", :workstation do _default b y -EOM + EOM end end diff --git a/spec/integration/knife/environment_show_spec.rb b/spec/integration/knife/environment_show_spec.rb index fdf41e70ce..c0334ecbf3 100644 --- a/spec/integration/knife/environment_show_spec.rb +++ b/spec/integration/knife/environment_show_spec.rb @@ -43,7 +43,7 @@ describe "knife environment show", :workstation do json_class: Chef::Environment name: b override_attributes: -EOM + EOM end # rubocop:enable Layout/TrailingWhitespace @@ -54,7 +54,7 @@ EOM baz: raz.my: mataz foo: bar -EOM + EOM end it "shows the requested nested attribute of an environment" do @@ -62,7 +62,7 @@ EOM b: default_attributes.baz: raz.my: mataz -EON + EON end it "shows the requested attribute of an environment with custom field separator" do @@ -70,7 +70,7 @@ EON b: default_attributes:baz: raz.my: mataz -EOT + EOT end end end diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb index 39a3f77fc5..830dd0e428 100644 --- a/spec/integration/knife/list_spec.rb +++ b/spec/integration/knife/list_spec.rb @@ -35,7 +35,7 @@ describe "knife list", :workstation do /nodes /roles /users -EOM + EOM end it "knife list -R / returns everything" do @@ -66,7 +66,7 @@ EOM /users: admin.json -EOM + EOM end end @@ -100,7 +100,7 @@ EOM /nodes /roles /users -EOM + EOM end it "knife list -R / returns everything" do @@ -163,7 +163,7 @@ EOM admin.json user1.json user2.json -EOM + EOM end it "knife list -R --flat / returns everything" do @@ -201,7 +201,7 @@ EOM /users/admin.json /users/user1.json /users/user2.json -EOM + EOM end it "knife list -Rfp / returns everything" do @@ -239,14 +239,14 @@ EOM /users/admin.json /users/user1.json /users/user2.json -EOM + EOM end it "knife list /cookbooks returns the list of cookbooks" do knife("list /cookbooks").should_succeed <<~EOM /cookbooks/cookbook1 /cookbooks/cookbook2 -EOM + EOM end it "knife list /cookbooks/*2/*/*.rb returns the one file" do @@ -258,7 +258,7 @@ EOM /cookbooks/cookbook1/metadata.rb /cookbooks/cookbook2/metadata.rb /cookbooks/cookbook2/recipes/default.rb -EOM + EOM end it "knife list /cookbooks/**.rb returns all ruby files" do @@ -266,7 +266,7 @@ EOM /cookbooks/cookbook1/metadata.rb /cookbooks/cookbook2/metadata.rb /cookbooks/cookbook2/recipes/default.rb -EOM + EOM end it "knife list /**.json returns all json files" do @@ -289,7 +289,7 @@ EOM /users/admin.json /users/user1.json /users/user2.json -EOM + EOM end it "knife list /data**.json returns all data bag json files" do @@ -298,7 +298,7 @@ EOM /data_bags/bag1/item2.json /data_bags/bag2/item1.json /data_bags/bag2/item2.json -EOM + EOM end it "knife list /environments/missing_file.json reports missing file" do @@ -351,7 +351,7 @@ EOM users/admin.json users/user1.json users/user2.json -EOM + EOM end end end @@ -396,7 +396,7 @@ EOM /users/admin.json /users/user1.json /users/user2.json -EOM + EOM end it "knife list -Rfp .. returns everything" do @@ -434,7 +434,7 @@ EOM /users/admin.json /users/user1.json /users/user2.json -EOM + EOM end it "knife list -Rfp returns cookbooks" do @@ -445,7 +445,7 @@ EOM cookbook2/metadata.rb cookbook2/recipes/ cookbook2/recipes/default.rb -EOM + EOM end end end @@ -461,7 +461,7 @@ EOM metadata.rb recipes/ recipes/default.rb -EOM + EOM end end end @@ -483,7 +483,7 @@ EOM cookbook2/metadata.rb cookbook2/recipes/ cookbook2/recipes/default.rb -EOM + EOM end end @@ -498,7 +498,7 @@ EOM cookbook2/metadata.rb cookbook2/recipes/ cookbook2/recipes/default.rb -EOM + EOM end end end @@ -520,7 +520,7 @@ EOM cookbook2/metadata.rb cookbook2/recipes/ cookbook2/recipes/default.rb -EOM + EOM end end @@ -535,7 +535,7 @@ EOM cookbook2/metadata.rb cookbook2/recipes/ cookbook2/recipes/default.rb -EOM + EOM end end end @@ -619,7 +619,7 @@ EOM /users/ /users/user1.json /users/user2.json -EOM + EOM end context "missing file/directory tests" do @@ -665,7 +665,7 @@ EOM /policies /policy_groups /roles -EOM + EOM end it "knife list -R / returns everything" do @@ -780,7 +780,7 @@ EOM /policy_groups: /roles: -EOM + EOM end end @@ -896,7 +896,7 @@ EOM /policy_groups: /roles: -EOM + EOM end context "has plenty of stuff in it" do @@ -1052,7 +1052,7 @@ EOM /roles/ /roles/role1.json /roles/role2.json -EOM + EOM end end end diff --git a/spec/integration/knife/node_bulk_delete_spec.rb b/spec/integration/knife/node_bulk_delete_spec.rb index 501091c0e7..4dce471150 100644 --- a/spec/integration/knife/node_bulk_delete_spec.rb +++ b/spec/integration/knife/node_bulk_delete_spec.rb @@ -39,12 +39,12 @@ describe "knife node bulk delete", :workstation do Are you sure you want to delete these nodes? (Y/N) Deleted node car Deleted node cat -EOM + EOM knife("node list").should_succeed <<~EOM cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/node_delete_spec.rb b/spec/integration/knife/node_delete_spec.rb index 9d8f382690..a578ae912e 100644 --- a/spec/integration/knife/node_delete_spec.rb +++ b/spec/integration/knife/node_delete_spec.rb @@ -34,13 +34,13 @@ describe "knife node delete", :workstation do it "deletes a node" do knife("node delete car", input: "Y").should_succeed <<~EOM Do you really want to delete car? (Y/N) Deleted node[car] -EOM + EOM knife("node list").should_succeed <<~EOM cat cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/node_environment_set_spec.rb b/spec/integration/knife/node_environment_set_spec.rb index 09d1828130..96251f6351 100644 --- a/spec/integration/knife/node_environment_set_spec.rb +++ b/spec/integration/knife/node_environment_set_spec.rb @@ -34,7 +34,7 @@ describe "knife node environment set", :workstation do knife("node show cons -a chef_environment").should_succeed <<~EOM cons: chef_environment: lisp -EOM + EOM end it "with no environment" do diff --git a/spec/integration/knife/node_from_file_spec.rb b/spec/integration/knife/node_from_file_spec.rb index f7a4717e7c..8a2dddb76e 100644 --- a/spec/integration/knife/node_from_file_spec.rb +++ b/spec/integration/knife/node_from_file_spec.rb @@ -43,14 +43,14 @@ describe "knife node from file", :workstation do ] } } -EOM + EOM end it "uploads a single file" do knife("node from file #{node_dir}/cons.json").should_succeed stderr: <<~EOM Updated Node cons -EOM + EOM end end diff --git a/spec/integration/knife/node_list_spec.rb b/spec/integration/knife/node_list_spec.rb index fd7394f00b..9e5378f121 100644 --- a/spec/integration/knife/node_list_spec.rb +++ b/spec/integration/knife/node_list_spec.rb @@ -37,7 +37,7 @@ describe "knife node list", :workstation do cat cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb index 04f14be335..8875654bc8 100644 --- a/spec/integration/knife/raw_spec.rb +++ b/spec/integration/knife/raw_spec.rb @@ -63,7 +63,7 @@ describe "knife raw", :workstation do ] } -EOM + EOM end it "knife raw /blarghle returns 404" do @@ -90,7 +90,7 @@ EOM } } -EOM + EOM knife("show /roles/x.json").should_fail "ERROR: /roles/x.json: No such file or directory\n" end @@ -115,7 +115,7 @@ EOM } } -EOM + EOM file.close knife("raw -m PUT -i #{file.path} /roles/x").should_succeed <<~EOM @@ -137,14 +137,14 @@ EOM } } -EOM + EOM knife("show /roles/x.json").should_succeed <<~EOM /roles/x.json: { "name": "x", "description": "eek" } -EOM + EOM end end @@ -166,21 +166,21 @@ EOM "env_run_lists": { } } -EOM + EOM file.close knife("raw -m POST -i #{file.path} /roles").should_succeed <<~EOM { "uri": "#{Chef::Config.chef_server_url}/roles/y" } -EOM + EOM knife("show /roles/y.json").should_succeed <<~EOM /roles/y.json: { "name": "y", "description": "eek" } -EOM + EOM end end @@ -206,13 +206,13 @@ EOM "x": "y", "a": "b" } -EOM + EOM end it "knife raw --no-pretty /blah returns the raw json" do knife("raw --no-pretty /blah").should_succeed <<~EOM { "x": "y", "a": "b" } -EOM + EOM end end @@ -235,13 +235,13 @@ EOM it "knife raw /blah returns the raw text" do knife("raw /blah").should_succeed(<<~EOM) { "x": "y", "a": "b" } -EOM + EOM end it "knife raw --no-pretty /blah returns the raw text" do knife("raw --no-pretty /blah").should_succeed(<<~EOM) { "x": "y", "a": "b" } -EOM + EOM end end end diff --git a/spec/integration/knife/role_bulk_delete_spec.rb b/spec/integration/knife/role_bulk_delete_spec.rb index 5a88ef282e..36d1cb2041 100644 --- a/spec/integration/knife/role_bulk_delete_spec.rb +++ b/spec/integration/knife/role_bulk_delete_spec.rb @@ -39,12 +39,12 @@ describe "knife role bulk delete", :workstation do Are you sure you want to delete these roles? (Y/N) Deleted role car Deleted role cat -EOM + EOM knife("role list").should_succeed <<~EOM cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/role_delete_spec.rb b/spec/integration/knife/role_delete_spec.rb index 875f80cede..aa12de57e8 100644 --- a/spec/integration/knife/role_delete_spec.rb +++ b/spec/integration/knife/role_delete_spec.rb @@ -34,13 +34,13 @@ describe "knife role delete", :workstation do it "deletes a role" do knife("role delete car", input: "Y").should_succeed <<~EOM Do you really want to delete car? (Y/N) Deleted role[car] -EOM + EOM knife("role list").should_succeed <<~EOM cat cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/role_from_file_spec.rb b/spec/integration/knife/role_from_file_spec.rb index bc93d0f6e0..69f58e8c36 100644 --- a/spec/integration/knife/role_from_file_spec.rb +++ b/spec/integration/knife/role_from_file_spec.rb @@ -42,7 +42,7 @@ describe "knife role from file", :workstation do } } -EOM + EOM file "roles/car.json", <<~EOM { @@ -57,7 +57,7 @@ EOM } } -EOM + EOM file "roles/cdr.json", <<~EOM { @@ -72,14 +72,14 @@ EOM } } -EOM + EOM end it "uploads a single file" do knife("role from file #{role_dir}/cons.json").should_succeed stderr: <<~EOM Updated Role cons -EOM + EOM end it "uploads many files" do @@ -87,7 +87,7 @@ EOM Updated Role cons Updated Role car Updated Role cdr -EOM + EOM end end diff --git a/spec/integration/knife/role_list_spec.rb b/spec/integration/knife/role_list_spec.rb index db13e521b5..e718425cee 100644 --- a/spec/integration/knife/role_list_spec.rb +++ b/spec/integration/knife/role_list_spec.rb @@ -37,7 +37,7 @@ describe "knife role list", :workstation do cat cdr cons -EOM + EOM end end diff --git a/spec/integration/knife/role_show_spec.rb b/spec/integration/knife/role_show_spec.rb index c2f5efedaf..07afd19440 100644 --- a/spec/integration/knife/role_show_spec.rb +++ b/spec/integration/knife/role_show_spec.rb @@ -42,7 +42,7 @@ describe "knife role show", :workstation do name: cons override_attributes: run_list: -EOM + EOM end # rubocop:enable Layout/TrailingWhitespace diff --git a/spec/integration/knife/show_spec.rb b/spec/integration/knife/show_spec.rb index df9f55fbf2..a4013802c5 100644 --- a/spec/integration/knife/show_spec.rb +++ b/spec/integration/knife/show_spec.rb @@ -52,13 +52,13 @@ describe "knife show", :workstation do knife("show /cookbooks/x/metadata.rb").should_succeed <<~EOM /cookbooks/x/metadata.rb: name "x"; version "1.0.0" -EOM + EOM end it "knife show --local /cookbooks/x/metadata.rb shows the local version" do knife("show --local /cookbooks/x/metadata.rb").should_succeed <<~EOM /cookbooks/x/metadata.rb: name "x"; version "1.0.0" -EOM + EOM end it "knife show /data_bags/x/y.json shows the remote version" do knife("show /data_bags/x/y.json").should_succeed <<~EOM @@ -66,7 +66,7 @@ EOM { "id": "y" } -EOM + EOM end it "knife show --local /data_bags/x/y.json shows the local version" do knife("show --local /data_bags/x/y.json").should_succeed <<~EOM @@ -74,7 +74,7 @@ EOM { "foo": "bar" } -EOM + EOM end it "knife show /environments/x.json shows the remote version", skip: (RUBY_VERSION < "1.9") do knife("show /environments/x.json").should_succeed <<~EOM @@ -82,7 +82,7 @@ EOM { "name": "x" } -EOM + EOM end it "knife show --local /environments/x.json shows the local version" do knife("show --local /environments/x.json").should_succeed <<~EOM @@ -90,7 +90,7 @@ EOM { "foo": "bar" } -EOM + EOM end it "knife show /roles/x.json shows the remote version", skip: (RUBY_VERSION < "1.9") do knife("show /roles/x.json").should_succeed <<~EOM @@ -98,7 +98,7 @@ EOM { "name": "x" } -EOM + EOM end it "knife show --local /roles/x.json shows the local version" do knife("show --local /roles/x.json").should_succeed <<~EOM @@ -106,7 +106,7 @@ EOM { "foo": "bar" } -EOM + EOM end # show directory it "knife show /data_bags/x fails" do @@ -151,7 +151,7 @@ EOM "x": "y" } } -EOM + EOM end end @@ -161,7 +161,7 @@ EOM knife("show --local /environments/x.json").should_succeed <<~EOM /environments/x.json: { -EOM + EOM end end end diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index 647c7773f9..3f42b08f21 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -64,7 +64,7 @@ describe "knife upload", :workstation do D\t/roles/x.json D\t/users/admin.json D\t/users/x.json -EOM + EOM end it "knife upload --purge deletes everything" do @@ -79,10 +79,10 @@ EOM Deleted extra entry /roles/x.json (purge is on) Deleted extra entry /users/admin.json (purge is on) Deleted extra entry /users/x.json (purge is on) -EOM + EOM knife("diff --name-status /").should_succeed <<~EOM D\t/environments/_default.json -EOM + EOM end end @@ -145,7 +145,7 @@ EOM ] } -EOM + EOM end it "knife upload / does not change anything" do @@ -159,7 +159,7 @@ EOM file "roles/x.rb", <<~EOM name "x" description "blargle" -EOM + EOM end it "knife upload changes the role" do @@ -208,7 +208,7 @@ EOM Created /nodes/y.json Created /roles/y.json Created /users/y.json -EOM + EOM knife("diff /").should_succeed "" end @@ -224,7 +224,7 @@ EOM Created /nodes/y.json Created /roles/y.json Created /users/y.json -EOM + EOM knife("diff --name-status /").should_succeed "" end end @@ -241,7 +241,7 @@ EOM D\t/nodes D\t/roles D\t/users -EOM + EOM end it "knife upload --purge deletes nothing" do @@ -253,7 +253,7 @@ EOM ERROR: /nodes cannot be deleted. ERROR: /roles cannot be deleted. ERROR: /users cannot be deleted. -EOM + EOM knife("diff --name-status /").should_succeed <<~EOM D\t/clients D\t/cookbooks @@ -262,7 +262,7 @@ EOM D\t/nodes D\t/roles D\t/users -EOM + EOM end context "when current directory is top level" do @@ -288,7 +288,7 @@ EOM knife("upload /data_bags/x/y.json").should_succeed <<~EOM Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<EOM EOM expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, create_additions: false).keys.sort).to eq(%w{foo id}) @@ -298,7 +298,7 @@ EOM knife("upload /data_bags/x /data_bags/x/y.json").should_succeed <<~EOM Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM end end @@ -312,7 +312,7 @@ EOM knife("upload /data_bags/x/y.json").should_succeed <<~EOM Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, create_additions: false) expect(result.keys.sort).to eq(%w{chef_type data_bag id}) @@ -331,10 +331,10 @@ EOM knife("upload /data_bags/x/y.json").should_succeed <<~EOM Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM A\t/data_bags/x/z.json -EOM + EOM end end end @@ -355,11 +355,11 @@ EOM it "knife upload of the modified file succeeds" do knife("upload /data_bags/x/modified.json").should_succeed <<~EOM Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/deleted.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload of the unmodified file does nothing" do knife("upload /data_bags/x/unmodified.json").should_succeed "" @@ -367,16 +367,16 @@ EOM D\t/data_bags/x/deleted.json M\t/data_bags/x/modified.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload of the added file succeeds" do knife("upload /data_bags/x/added.json").should_succeed <<~EOM Created /data_bags/x/added.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/deleted.json M\t/data_bags/x/modified.json -EOM + EOM end it "knife upload of the deleted file does nothing" do knife("upload /data_bags/x/deleted.json").should_succeed "" @@ -384,32 +384,32 @@ EOM D\t/data_bags/x/deleted.json M\t/data_bags/x/modified.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload --purge of the deleted file deletes it" do knife("upload --purge /data_bags/x/deleted.json").should_succeed <<~EOM Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM M\t/data_bags/x/modified.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload of the entire data bag uploads everything" do knife("upload /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/deleted.json -EOM + EOM end it "knife upload --purge of the entire data bag uploads everything" do knife("upload --purge /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end context "when cwd is the /data_bags directory" do @@ -427,7 +427,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end it "knife upload --purge * uploads everything" do @@ -435,7 +435,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end end @@ -468,13 +468,13 @@ EOM it "knife upload of the cookbook itself succeeds" do knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end it "knife upload --purge of the cookbook itself succeeds" do knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -487,7 +487,7 @@ EOM it "knife upload of the cookbook succeeds" do knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -502,7 +502,7 @@ EOM it "knife upload of the cookbook succeeds" do knife("upload /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -515,7 +515,7 @@ EOM it "knife upload --freeze freezes the cookbook" do knife("upload --freeze /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM # Modify a file and attempt to upload file "cookbooks/x/metadata.rb", 'name "x"; version "1.0.0"#different' knife("upload /cookbooks/x").should_fail "ERROR: /cookbooks failed to write: Cookbook x is frozen\n" @@ -540,7 +540,7 @@ EOM it "knife upload --force uploads the frozen cookbook" do knife("upload --force /cookbooks/frozencook").should_succeed <<~EOM Updated /cookbooks/frozencook -EOM + EOM end end end @@ -562,15 +562,15 @@ EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM end end @@ -583,7 +583,7 @@ EOM it "knife upload /cookbooks/x uploads the local version" do knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -598,27 +598,27 @@ EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x/metadata.rb D\t/cookbooks/x/onlyin1.0.1.rb A\t/cookbooks/x/onlyin1.0.0.rb -EOM + EOM end end when_the_chef_server "has an earlier version for the cookbook, and no current version" do before do - cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" } + cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" } end it "knife upload /cookbooks/x uploads the new version" do knife("upload --purge /cookbooks/x").should_succeed <<~EOM Updated /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -718,7 +718,7 @@ EOM it "knife upload succeeds" do knife("upload /cookbooks/x").should_succeed <<~EOM Created /cookbooks/x -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -763,7 +763,7 @@ EOM D\t/roles/x.json D\t/users/admin.json D\t/users/x.json -EOM + EOM end it "knife upload --purge deletes everything" do @@ -778,10 +778,10 @@ EOM Deleted extra entry /roles/x.json (purge is on) Deleted extra entry /users/admin.json (purge is on) Deleted extra entry /users/x.json (purge is on) -EOM + EOM knife("diff --name-status /").should_succeed <<~EOM D\t/environments/_default.json -EOM + EOM end end @@ -840,7 +840,7 @@ EOM ] } -EOM + EOM end it "knife upload / does not change anything" do @@ -876,7 +876,7 @@ EOM Created /nodes/y.json Created /roles/y.json Created /users/y.json -EOM + EOM knife("diff --name-status /").should_succeed "" end end @@ -893,7 +893,7 @@ EOM D\t/nodes D\t/roles D\t/users -EOM + EOM end it "knife upload --purge deletes nothing" do @@ -905,7 +905,7 @@ EOM ERROR: /nodes cannot be deleted. ERROR: /roles cannot be deleted. ERROR: /users cannot be deleted. -EOM + EOM knife("diff --name-status /").should_succeed <<~EOM D\t/clients D\t/cookbooks @@ -914,7 +914,7 @@ EOM D\t/nodes D\t/roles D\t/users -EOM + EOM end context "when current directory is top level" do @@ -940,10 +940,10 @@ EOM knife("upload /data_bags/x/y.json").should_succeed <<~EOM Created /data_bags/x Created /data_bags/x/y.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM A\t/data_bags/x/z.json -EOM + EOM end end end @@ -962,11 +962,11 @@ EOM it "knife upload of the modified file succeeds" do knife("upload /data_bags/x/modified.json").should_succeed <<~EOM Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/deleted.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload of the unmodified file does nothing" do knife("upload /data_bags/x/unmodified.json").should_succeed "" @@ -974,16 +974,16 @@ EOM D\t/data_bags/x/deleted.json M\t/data_bags/x/modified.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload of the added file succeeds" do knife("upload /data_bags/x/added.json").should_succeed <<~EOM Created /data_bags/x/added.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/deleted.json M\t/data_bags/x/modified.json -EOM + EOM end it "knife upload of the deleted file does nothing" do knife("upload /data_bags/x/deleted.json").should_succeed "" @@ -991,32 +991,32 @@ EOM D\t/data_bags/x/deleted.json M\t/data_bags/x/modified.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload --purge of the deleted file deletes it" do knife("upload --purge /data_bags/x/deleted.json").should_succeed <<~EOM Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM M\t/data_bags/x/modified.json A\t/data_bags/x/added.json -EOM + EOM end it "knife upload of the entire data bag uploads everything" do knife("upload /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json -EOM + EOM knife("diff --name-status /data_bags").should_succeed <<~EOM D\t/data_bags/x/deleted.json -EOM + EOM end it "knife upload --purge of the entire data bag uploads everything" do knife("upload --purge /data_bags/x").should_succeed <<~EOM Created /data_bags/x/added.json Updated /data_bags/x/modified.json Deleted extra entry /data_bags/x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end context "when cwd is the /data_bags directory" do @@ -1031,7 +1031,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end it "knife upload --purge * uploads everything" do @@ -1039,7 +1039,7 @@ EOM Created x/added.json Updated x/modified.json Deleted extra entry x/deleted.json (purge is on) -EOM + EOM knife("diff --name-status /data_bags").should_succeed "" end end @@ -1072,14 +1072,14 @@ EOM it "knife upload of the cookbook itself succeeds" do knife("upload /cookbooks/x-1.0.0").should_succeed <<~EOM Updated /cookbooks/x-1.0.0 -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end it "knife upload --purge of the cookbook itself succeeds" do knife("upload /cookbooks/x-1.0.0").should_succeed <<~EOM Updated /cookbooks/x-1.0.0 -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1092,7 +1092,7 @@ EOM it "knife upload of the cookbook succeeds" do knife("upload /cookbooks/x-1.0.0").should_succeed <<~EOM Updated /cookbooks/x-1.0.0 -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1107,7 +1107,7 @@ EOM it "knife upload of the cookbook succeeds" do knife("upload /cookbooks/x-1.0.0").should_succeed <<~EOM Updated /cookbooks/x-1.0.0 -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1129,11 +1129,11 @@ EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM M\t/cookbooks/x-1.0.0/onlyin1.0.0.rb D\t/cookbooks/x-1.0.1 -EOM + EOM knife("upload --purge /cookbooks").should_succeed <<~EOM Updated /cookbooks/x-1.0.0 Deleted extra entry /cookbooks/x-1.0.1 (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1147,7 +1147,7 @@ EOM knife("upload --purge /cookbooks").should_succeed <<~EOM Updated /cookbooks/x-1.0.0 Deleted extra entry /cookbooks/x-0.9.9 (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1161,11 +1161,11 @@ EOM knife("diff --name-status /cookbooks").should_succeed <<~EOM D\t/cookbooks/x-1.0.1 A\t/cookbooks/x-1.0.0 -EOM + EOM knife("upload --purge /cookbooks").should_succeed <<~EOM Created /cookbooks/x-1.0.0 Deleted extra entry /cookbooks/x-1.0.1 (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1179,7 +1179,7 @@ EOM knife("upload --purge /cookbooks").should_succeed <<~EOM Created /cookbooks/x-1.0.0 Deleted extra entry /cookbooks/x-0.9.9 (purge is on) -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1252,7 +1252,7 @@ EOM it "knife upload succeeds" do knife("upload /cookbooks/x-1.0.0").should_succeed <<~EOM Created /cookbooks/x-1.0.0 -EOM + EOM knife("diff --name-status /cookbooks").should_succeed "" end end @@ -1331,7 +1331,7 @@ EOM Created /policies/x-1.0.0.json Created /policy_groups/x.json Created /roles/x.json -EOM + EOM expect(api.get("association_requests").map { |a| a["username"] }).to eq([ "foo" ]) expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ]) knife("diff --name-status --diff-filter=AMT /").should_succeed "" @@ -1368,7 +1368,7 @@ EOM it "knife upload makes no changes" do knife("upload /").should_succeed <<~EOM Updated /acls/groups/blah.json -EOM + EOM end end @@ -1380,7 +1380,7 @@ EOM it "should fail because policies are not updateable" do knife("upload /policies/x-1.0.0.json").should_fail <<~EOM ERROR: /policies/x-1.0.0.json cannot be updated: policy revisions are immutable once uploaded. If you want to change the policy, create a new revision with your changes. -EOM + EOM end end @@ -1392,7 +1392,7 @@ EOM it "should fail because cookbook_artifacts cannot be updated" do knife("upload /cookbook_artifacts/x-1x1").should_fail <<~EOM ERROR: /cookbook_artifacts/x-1x1 cannot be updated: cookbook artifacts are immutable once uploaded. -EOM + EOM end end @@ -1434,7 +1434,7 @@ EOM Created /policies/blah-1.0.0.json Updated /policy_groups/x.json Updated /roles/x.json -EOM + EOM knife("diff --name-status --diff-filter=AMT /").should_succeed "" end end |