diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:30:53 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:30:53 -0700 |
commit | 34a6dd714503abbb0e6d240a4832f245d5c3ab06 (patch) | |
tree | 90e7b709c931ad394ebf9fc4490145405776ea94 /spec | |
parent | 878560a22f37aec0c2dfe681b3743e027155be88 (diff) | |
download | chef-34a6dd714503abbb0e6d240a4832f245d5c3ab06.tar.gz |
clean up whitespace again
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec')
27 files changed, 242 insertions, 242 deletions
diff --git a/spec/functional/resource/dsc_script_spec.rb b/spec/functional/resource/dsc_script_spec.rb index 3b7042610b..e9301d4231 100644 --- a/spec/functional/resource/dsc_script_spec.rb +++ b/spec/functional/resource/dsc_script_spec.rb @@ -154,7 +154,7 @@ EOH $testuser = #{dsc_user_code} $testpassword = ConvertTo-SecureString -String "jf9a8m49jrajf4#" -AsPlainText -Force $testcred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $testuser, $testpassword - + User dsctestusercreate { UserName = $testuser @@ -179,7 +179,7 @@ EOH } ) } - + EOH end @@ -424,7 +424,7 @@ EOH $cert = ls Cert:\\LocalMachine\\My\\ | Where-Object {$_.Subject -match "ChefTest"} | Select -first 1 - + if($cert -eq $null) { $pfxpath = '#{self_signed_cert_path}' $password = '' @@ -434,7 +434,7 @@ EOH $store.Add($cert) $store.Close() } - + lcm -thumbprint $cert.thumbprint set-dsclocalconfigurationmanager -path ./LCM $ConfigurationData = @" diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb index f1ab02dceb..9df0b9def9 100644 --- a/spec/integration/knife/chef_repo_path_spec.rb +++ b/spec/integration/knife/chef_repo_path_spec.rb @@ -362,7 +362,7 @@ EOM knife("show --local /clients/blah.json").should_succeed <<~EOM /clients/blah.json: { - + } EOM end @@ -462,7 +462,7 @@ EOM knife("show --local /environments/blah.json").should_succeed <<~EOM /environments/blah.json: { - + } EOM end @@ -477,7 +477,7 @@ EOM knife("show --local /nodes/blah.json").should_succeed <<~EOM /nodes/blah.json: { - + } EOM end @@ -492,7 +492,7 @@ EOM knife("show --local /roles/blah.json").should_succeed <<~EOM /roles/blah.json: { - + } EOM end @@ -507,7 +507,7 @@ EOM knife("show --local /users/blah.json").should_succeed <<~EOM /users/blah.json: { - + } EOM end diff --git a/spec/integration/knife/client_bulk_delete_spec.rb b/spec/integration/knife/client_bulk_delete_spec.rb index 336852c0b8..42bfe0396a 100644 --- a/spec/integration/knife/client_bulk_delete_spec.rb +++ b/spec/integration/knife/client_bulk_delete_spec.rb @@ -35,9 +35,9 @@ describe "knife client bulk delete", :workstation do it "deletes all matching clients" do knife("client bulk delete ^ca.*", input: "Y").should_succeed <<~EOM The following clients will be deleted: - + car cat - + Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat EOM @@ -54,9 +54,9 @@ EOM it "deletes all matching clients when unanchored" do knife("client bulk delete ca.*", input: "Y").should_succeed <<~EOM The following clients will be deleted: - + car cat concat - + Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat Deleted client concat @@ -83,14 +83,14 @@ EOM it "refuses to delete a validator normally" do knife("client bulk delete ^ca.*", input: "Y").should_succeed <<~EOM The following clients are validators and will not be deleted: - + car-validator - + You must specify --delete-validators to delete the validator clients The following clients will be deleted: - + car cat - + Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat EOM @@ -107,14 +107,14 @@ EOM it "deletes a validator when told to" do knife("client bulk delete ^ca.* -D", input: "Y\nY").should_succeed <<~EOM The following validators will be deleted: - + car-validator - + Are you sure you want to delete these validators? (Y/N) Deleted client car-validator The following clients will be deleted: - + car cat - + Are you sure you want to delete these clients? (Y/N) Deleted client car Deleted client cat EOM diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index 12e14fce04..04610ba4e7 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -107,7 +107,7 @@ EOM "override_attributes": { }, "run_list": [ - + ] } EOM @@ -139,7 +139,7 @@ EOM "override_attributes": { }, "run_list": [ - + ] } EOM @@ -564,7 +564,7 @@ EOM WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF { (right here) ------^ - + EOH knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", stderr: warning knife("diff --name-status /environments/x.json").should_succeed "" @@ -687,7 +687,7 @@ EOM "override_attributes": { }, "run_list": [ - + ] } EOM diff --git a/spec/integration/knife/environment_from_file_spec.rb b/spec/integration/knife/environment_from_file_spec.rb index 0831ef5518..8948a3772c 100644 --- a/spec/integration/knife/environment_from_file_spec.rb +++ b/spec/integration/knife/environment_from_file_spec.rb @@ -34,7 +34,7 @@ describe "knife environment from file", :workstation do "name": "cons", "description": "An environment", "cookbook_versions": { - + }, "json_class": "Chef::Environment", "chef_type": "environment", @@ -42,7 +42,7 @@ describe "knife environment from file", :workstation do "hola": "Amigos!" }, "override_attributes": { - + } } EOM @@ -52,7 +52,7 @@ EOM "name": "car", "description": "An environment for list nodes", "cookbook_versions": { - + }, "json_class": "Chef::Environment", "chef_type": "environment", @@ -60,7 +60,7 @@ EOM "hola": "Amigos!" }, "override_attributes": { - + } } EOM @@ -70,7 +70,7 @@ EOM "name": "cdr", "description": "An environment for last nodes", "cookbook_versions": { - + }, "json_class": "Chef::Environment", "chef_type": "environment", @@ -78,7 +78,7 @@ EOM "hola": "Amigos!" }, "override_attributes": { - + } } EOM diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb index bee9892220..39a3f77fc5 100644 --- a/spec/integration/knife/list_spec.rb +++ b/spec/integration/knife/list_spec.rb @@ -48,22 +48,22 @@ EOM nodes roles users - + /clients: chef-validator.json chef-webui.json - + /cookbooks: - + /data_bags: - + /environments: _default.json - + /nodes: - + /roles: - + /users: admin.json EOM @@ -113,52 +113,52 @@ EOM nodes roles users - + /clients: chef-validator.json chef-webui.json client1.json client2.json - + /cookbooks: cookbook1 cookbook2 - + /cookbooks/cookbook1: metadata.rb - + /cookbooks/cookbook2: metadata.rb recipes - + /cookbooks/cookbook2/recipes: default.rb - + /data_bags: bag1 bag2 - + /data_bags/bag1: item1.json item2.json - + /data_bags/bag2: item1.json item2.json - + /environments: _default.json environment1.json environment2.json - + /nodes: node1.json node2.json - + /roles: role1.json role2.json - + /users: admin.json user1.json @@ -686,7 +686,7 @@ EOM policies policy_groups roles - + /acls: clients containers @@ -700,10 +700,10 @@ EOM policies policy_groups roles - + /acls/clients: foo-validator.json - + /acls/containers: clients.json containers.json @@ -717,33 +717,33 @@ EOM policy_groups.json roles.json sandboxes.json - + /acls/cookbook_artifacts: - + /acls/cookbooks: - + /acls/data_bags: - + /acls/environments: _default.json - + /acls/groups: admins.json billing-admins.json clients.json users.json - + /acls/nodes: - + /acls/policies: - + /acls/policy_groups: - + /acls/roles: - + /clients: foo-validator.json - + /containers: clients.json containers.json @@ -757,28 +757,28 @@ EOM policy_groups.json roles.json sandboxes.json - + /cookbook_artifacts: - + /cookbooks: - + /data_bags: - + /environments: _default.json - + /groups: admins.json billing-admins.json clients.json users.json - + /nodes: - + /policies: - + /policy_groups: - + /roles: EOM end @@ -802,7 +802,7 @@ EOM policies policy_groups roles - + /acls: clients containers @@ -816,10 +816,10 @@ EOM policies policy_groups roles - + /acls/clients: foo-validator.json - + /acls/containers: clients.json containers.json @@ -833,33 +833,33 @@ EOM policy_groups.json roles.json sandboxes.json - + /acls/cookbook_artifacts: - + /acls/cookbooks: - + /acls/data_bags: - + /acls/environments: _default.json - + /acls/groups: admins.json billing-admins.json clients.json users.json - + /acls/nodes: - + /acls/policies: - + /acls/policy_groups: - + /acls/roles: - + /clients: foo-validator.json - + /containers: clients.json containers.json @@ -873,28 +873,28 @@ EOM policy_groups.json roles.json sandboxes.json - + /cookbook_artifacts: - + /cookbooks: - + /data_bags: - + /environments: _default.json - + /groups: admins.json billing-admins.json clients.json users.json - + /nodes: - + /policies: - + /policy_groups: - + /roles: EOM end diff --git a/spec/integration/knife/node_bulk_delete_spec.rb b/spec/integration/knife/node_bulk_delete_spec.rb index dfac031068..501091c0e7 100644 --- a/spec/integration/knife/node_bulk_delete_spec.rb +++ b/spec/integration/knife/node_bulk_delete_spec.rb @@ -34,9 +34,9 @@ describe "knife node bulk delete", :workstation do it "deletes all matching nodes" do knife("node bulk delete ^ca.*", input: "Y").should_succeed <<~EOM The following nodes will be deleted: - + car cat - + Are you sure you want to delete these nodes? (Y/N) Deleted node car Deleted node cat EOM diff --git a/spec/integration/knife/node_from_file_spec.rb b/spec/integration/knife/node_from_file_spec.rb index e58dfddee4..f7a4717e7c 100644 --- a/spec/integration/knife/node_from_file_spec.rb +++ b/spec/integration/knife/node_from_file_spec.rb @@ -39,7 +39,7 @@ describe "knife node from file", :workstation do , "normal": { "tags": [ - + ] } } diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb index 35f5130145..1c8239746f 100644 --- a/spec/integration/knife/raw_spec.rb +++ b/spec/integration/knife/raw_spec.rb @@ -46,21 +46,21 @@ describe "knife raw", :workstation do "chef_type": "node", "chef_environment": "_default", "override": { - + }, "normal": { "tags": [ - + ] }, "default": { - + }, "automatic": { - + }, "run_list": [ - + ] } EOM @@ -78,16 +78,16 @@ EOM "json_class": "Chef::Role", "chef_type": "role", "default_attributes": { - + }, "override_attributes": { - + }, "run_list": [ - + ], "env_run_lists": { - + } } EOM @@ -103,16 +103,16 @@ EOM "json_class": "Chef::Role", "chef_type": "role", "default_attributes": { - + }, "override_attributes": { - + }, "run_list": [ - + ], "env_run_lists": { - + } } EOM @@ -125,16 +125,16 @@ EOM "json_class": "Chef::Role", "chef_type": "role", "default_attributes": { - + }, "override_attributes": { - + }, "run_list": [ - + ], "env_run_lists": { - + } } EOM @@ -161,7 +161,7 @@ EOM "override_attributes": { }, "run_list": [ - + ], "env_run_lists": { } diff --git a/spec/integration/knife/role_bulk_delete_spec.rb b/spec/integration/knife/role_bulk_delete_spec.rb index 40aef97c07..5a88ef282e 100644 --- a/spec/integration/knife/role_bulk_delete_spec.rb +++ b/spec/integration/knife/role_bulk_delete_spec.rb @@ -34,9 +34,9 @@ describe "knife role bulk delete", :workstation do it "deletes all matching roles" do knife("role bulk delete ^ca.*", input: "Y").should_succeed <<~EOM The following roles will be deleted: - + car cat - + Are you sure you want to delete these roles? (Y/N) Deleted role car Deleted role cat EOM diff --git a/spec/integration/knife/role_from_file_spec.rb b/spec/integration/knife/role_from_file_spec.rb index ca1c17380d..bc93d0f6e0 100644 --- a/spec/integration/knife/role_from_file_spec.rb +++ b/spec/integration/knife/role_from_file_spec.rb @@ -39,7 +39,7 @@ describe "knife role from file", :workstation do "hola": "Amigos!" }, "override_attributes": { - + } } EOM @@ -54,7 +54,7 @@ EOM "hola": "Amigos!" }, "override_attributes": { - + } } EOM @@ -69,7 +69,7 @@ EOM "hola": "Amigos!" }, "override_attributes": { - + } } EOM diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index 4a3247ccd7..647c7773f9 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -142,7 +142,7 @@ EOM "override_attributes": { }, "run_list": [ - + ] } EOM @@ -639,7 +639,7 @@ EOM WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF { (right here) ------^ - + ERROR: /environments/x.json failed to write: Parse error reading JSON: parse error: premature EOF { (right here) ------^ @@ -649,7 +649,7 @@ EOM WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF { (right here) ------^ - + EOH knife("upload /environments/x.json").should_fail(error1) knife("diff --name-status /environments/x.json").should_succeed("M\t/environments/x.json\n", stderr: warn) @@ -837,7 +837,7 @@ EOM "override_attributes": { }, "run_list": [ - + ] } EOM diff --git a/spec/integration/recipes/notifies_spec.rb b/spec/integration/recipes/notifies_spec.rb index 596f7b1970..d9e89e7f1e 100644 --- a/spec/integration/recipes/notifies_spec.rb +++ b/spec/integration/recipes/notifies_spec.rb @@ -47,7 +47,7 @@ EOM default_action :run provides :notifying_test resource_name :notifying_test - + action :run do log "bar" do notifies :write, 'log[foo]', :delayed @@ -88,7 +88,7 @@ EOM default_action :run provides :notifying_test resource_name :notifying_test - + action :run do log "bar" do notifies :write, 'log[foo]', :delayed @@ -133,7 +133,7 @@ EOM default_action :run provides :notifying_test resource_name :notifying_test - + action :run do log "bar" do notifies :write, 'log[foo]', :delayed @@ -214,7 +214,7 @@ EOM default_action :run provides :notifying_test resource_name :notifying_test - + action :run do log "bar" do notifies :write, 'log[foo]', :immediately @@ -254,7 +254,7 @@ EOM default_action :run provides :notifying_test resource_name :notifying_test - + action :run do log "bar" do notifies :write, resources(log: "foo"), :immediately @@ -294,7 +294,7 @@ EOM default_action :run provides :notifying_test resource_name :notifying_test - + action :run do log "bar" do notifies :write, "log[foo]" @@ -331,7 +331,7 @@ EOM default_action :run provides :cloning_test resource_name :cloning_test - + action :run do log "bar" do level :info @@ -343,7 +343,7 @@ EOM log "bar" do level :warn end - + cloning_test "whatever" EOM diff --git a/spec/unit/formatters/error_description_spec.rb b/spec/unit/formatters/error_description_spec.rb index a09d295c9b..772ad84481 100644 --- a/spec/unit/formatters/error_description_spec.rb +++ b/spec/unit/formatters/error_description_spec.rb @@ -73,14 +73,14 @@ describe Chef::Formatters::ErrorDescription do ================================================================================ test title ================================================================================ - + System Info: ------------ chef_version=1.2.3 ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] program_name=chef-client executable=/test/bin/chef-client - + END end end @@ -96,18 +96,18 @@ describe Chef::Formatters::ErrorDescription do ================================================================================ test title ================================================================================ - + test heading ------------ test text - + System Info: ------------ chef_version=1.2.3 ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] program_name=chef-client executable=/test/bin/chef-client - + END end @@ -123,7 +123,7 @@ describe Chef::Formatters::ErrorDescription do ================================================================================ test title ================================================================================ - + System Info: ------------ chef_version=1.2.3 @@ -132,7 +132,7 @@ describe Chef::Formatters::ErrorDescription do ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] program_name=chef-client executable=/test/bin/chef-client - + END end diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb index 9ec2c8d567..a09b192b6d 100644 --- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb @@ -27,8 +27,8 @@ BAD_RECIPE = <<~E # # All rights reserved - Do Not Redistribute # - - + + file "/tmp/explode-me" do mode 0655 owner "root" diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index 3110ba7496..74612f520d 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -115,7 +115,7 @@ describe Chef::Knife::CookbookUpload do 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: diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index 65463005c9..025c1ecd91 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -250,7 +250,7 @@ EOM expect(@out.string).to eq <<~EOM a b - + c d EOM @@ -261,10 +261,10 @@ EOM expect(@out.string).to eq <<~EOM a b - + c - - + + d e EOM @@ -275,9 +275,9 @@ EOM expect(@out.string).to eq <<~EOM a: b c: d - + x: y - + m: n o: p EOM diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb index 6c4caa4656..c77b0e0528 100644 --- a/spec/unit/provider/cron/unix_spec.rb +++ b/spec/unit/provider/cron/unix_spec.rb @@ -55,10 +55,10 @@ describe Chef::Provider::Cron::Unix do let(:stdout) do String.new(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: something else * 5 * * * /bin/true - + # Another comment CRONTAB end diff --git a/spec/unit/provider/cron_spec.rb b/spec/unit/provider/cron_spec.rb index 50ebff779d..67d578e2ea 100644 --- a/spec/unit/provider/cron_spec.rb +++ b/spec/unit/provider/cron_spec.rb @@ -44,12 +44,12 @@ describe Chef::Provider::Cron do before :each do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff @reboot /bin/true param1 param2 # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB end @@ -69,7 +69,7 @@ CRONTAB it "should pull env vars out" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO=foo@example.com SHELL=/bin/foosh @@ -78,7 +78,7 @@ CRONTAB @reboot /bin/true param1 param2 # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB cron = @provider.load_current_resource @@ -170,10 +170,10 @@ CRONTAB before :each do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: something else * 5 * * * /bin/true - + # Another comment CRONTAB end @@ -204,12 +204,12 @@ CRONTAB before :each do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff * 5 * 1 * /bin/true param1 param2 # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB end @@ -234,7 +234,7 @@ CRONTAB it "should pull env vars out" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO=foo@example.com SHELL=/bin/foosh @@ -243,7 +243,7 @@ CRONTAB * 5 * 1 * /bin/true param1 param2 # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB cron = @provider.load_current_resource @@ -300,12 +300,12 @@ CRONTAB before :each do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff * 5 * Jan Mon /bin/true param1 param2 # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB end @@ -336,7 +336,7 @@ CRONTAB it "should set cron_exists and leave current_resource values at defaults" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff CRONTAB cron = @provider.load_current_resource @@ -353,7 +353,7 @@ CRONTAB it "should not pick up a commented out crontab line" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff #* 5 * 1 * /bin/true param1 param2 CRONTAB @@ -371,12 +371,12 @@ CRONTAB it "should not pick up a later crontab entry" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff #* 5 * 1 * /bin/true param1 param2 # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB cron = @provider.load_current_resource @@ -483,10 +483,10 @@ CRONTAB @provider.cron_exists = false allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB end @@ -494,10 +494,10 @@ CRONTAB it "should add the entry to the crontab" do expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment # Chef Name: cronhole some stuff 30 * * * * /bin/true @@ -513,10 +513,10 @@ CRONTAB @new_resource.environment "TEST" => "LOL" expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment # Chef Name: cronhole some stuff MAILTO="foo@example.com" @@ -546,12 +546,12 @@ CRONTAB allow(@provider).to receive(:cron_different?).and_return(true) allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff 30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB end @@ -559,12 +559,12 @@ CRONTAB it "should update the crontab entry" do expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff 30 * * * * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:create) @@ -578,7 +578,7 @@ CRONTAB @new_resource.environment "TEST" => "LOL" expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO="foo@example.com" PATH="/usr/bin:/my/custom/path" @@ -588,7 +588,7 @@ CRONTAB 30 * * * * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:create) @@ -614,12 +614,12 @@ CRONTAB it "should add the crontab to the entry" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff CRONTAB expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff 30 * * * * /bin/true ENDCRON @@ -629,23 +629,23 @@ CRONTAB it "should not blat any following entries" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff #30 * * * * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff 30 * * * * /bin/true #30 * * * * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:create) @@ -654,16 +654,16 @@ CRONTAB it "should handle env vars with no crontab" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO=bar@example.com PATH=/usr/bin:/my/custom/path SHELL=/bin/barsh HOME=/home/foo - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB @new_resource.mailto "foo@example.com" @@ -672,17 +672,17 @@ CRONTAB @new_resource.home "/home/foo" expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO="foo@example.com" PATH="/usr/bin:/my/custom/path" SHELL="/bin/foosh" HOME="/home/foo" 30 * * * * /bin/true - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:create) @@ -695,10 +695,10 @@ CRONTAB allow(@provider).to receive(:cron_different?).and_return(false) allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff * 5 * * * /bin/true - + # Another comment CRONTAB end @@ -749,12 +749,12 @@ CRONTAB @provider.cron_exists = true allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff 30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB end @@ -762,10 +762,10 @@ CRONTAB it "should remove the entry" do expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:delete) @@ -774,22 +774,22 @@ CRONTAB it "should remove any env vars with the entry" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO=foo@example.com FOO=test 30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:delete) @@ -814,12 +814,12 @@ CRONTAB it "should remove the section" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff CRONTAB expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + ENDCRON @provider.run_action(:delete) end @@ -827,21 +827,21 @@ CRONTAB it "should not blat following sections" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff #30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + #30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:delete) @@ -850,22 +850,22 @@ CRONTAB it "should remove any envvars with the section" do allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB) 0 2 * * * /some/other/command - + # Chef Name: cronhole some stuff MAILTO=foo@example.com #30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment CRONTAB expect(@provider).to receive(:write_crontab).with(<<~ENDCRON) 0 2 * * * /some/other/command - + #30 * * 3 * /bin/true # Chef Name: something else 2 * 1 * * /bin/false - + # Another comment ENDCRON @provider.run_action(:delete) @@ -877,10 +877,10 @@ CRONTAB before :each do @stdout = <<~CRONTAB 0 2 * * * /some/other/command - + # Chef Name: something else * 5 * * * /bin/true - + # Another comment CRONTAB @status = double("Status", exitstatus: 0, stdout: @stdout) @@ -896,10 +896,10 @@ CRONTAB crontab = @provider.send(:read_crontab) expect(crontab).to eq <<~CRONTAB 0 2 * * * /some/other/command - + # Chef Name: something else * 5 * * * /bin/true - + # Another comment CRONTAB end diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb index 409bd46ecc..80a83130e9 100644 --- a/spec/unit/provider/mount/aix_spec.rb +++ b/spec/unit/provider/mount/aix_spec.rb @@ -242,7 +242,7 @@ WRONG vol = /opt free = false quota = no - + /tmp/abc: dev = /dev/sdz2 vfs = jfs2 diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb index 97eda1d774..05be08f332 100644 --- a/spec/unit/provider/package/apt_spec.rb +++ b/spec/unit/provider/package/apt_spec.rb @@ -126,7 +126,7 @@ describe Chef::Provider::Package::Apt do showpkg_out = <<~SHOWPKG_STDOUT Package: libmysqlclient15-dev Versions: - + Reverse Depends: libmysqlclient-dev,libmysqlclient15-dev libmysqlclient-dev,libmysqlclient15-dev @@ -186,7 +186,7 @@ describe Chef::Provider::Package::Apt do showpkg_out = <<~SHOWPKG_STDOUT Package: mp3-decoder Versions: - + Reverse Depends: nautilus,mp3-decoder vux,mp3-decoder diff --git a/spec/unit/provider/package/cab_spec.rb b/spec/unit/provider/package/cab_spec.rb index bdfcd06be3..9c5865ec31 100644 --- a/spec/unit/provider/package/cab_spec.rb +++ b/spec/unit/provider/package/cab_spec.rb @@ -60,9 +60,9 @@ describe Chef::Provider::Package::Cab do get_package_info_stdout = <<~EOF Deployment Image Servicing and Management tool Version: 6.1.7600.16385 - + Image Version: 6.1.7600.16385 - + Package information: Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0 Applicable : Yes @@ -84,26 +84,26 @@ describe Chef::Provider::Package::Cab do get_packages_stdout = <<~EOF Deployment Image Servicing and Management tool Version: 6.1.7600.16385 - + Image Version: 6.1.7600.16385 - + Packages listing: - + Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0 State : Installed Release Type : Language Pack Install Time : 2/11/2015 11:33 PM - + Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0 State : Installed Release Type : Language Pack Install Time : 2/11/2015 11:33 PM - + Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0 State : Installed Release Type : Feature Pack Install Time : 11/21/2010 3:40 AM - + The operation completed successfully. EOF get_packages_obj = double(stdout: get_packages_stdout) diff --git a/spec/unit/provider/package/ips_spec.rb b/spec/unit/provider/package/ips_spec.rb index b5fb05f7ec..70e1c3fe32 100644 --- a/spec/unit/provider/package/ips_spec.rb +++ b/spec/unit/provider/package/ips_spec.rb @@ -38,7 +38,7 @@ describe Chef::Provider::Package::Ips do stderr = <<~PKG_STATUS pkg: info: no packages matching the following patterns you specified are installed on the system. Try specifying -r to query remotely: - + crypto/gnupg PKG_STATUS OpenStruct.new(stdout: stdout, stdin: stdin, stderr: stderr, status: @status, exitstatus: 1) diff --git a/spec/unit/provider/package/msu_spec.rb b/spec/unit/provider/package/msu_spec.rb index 49b723e572..b2f0b22963 100644 --- a/spec/unit/provider/package/msu_spec.rb +++ b/spec/unit/provider/package/msu_spec.rb @@ -52,9 +52,9 @@ describe Chef::Provider::Package::Msu, :windows_only do <<~EOF Deployment Image Servicing and Management tool Version: 6.1.7600.16385 - + Image Version: 6.1.7600.16385 - + Package information: Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0 Applicable : Yes @@ -70,26 +70,26 @@ describe Chef::Provider::Package::Msu, :windows_only do get_packages_stdout = <<~EOF Deployment Image Servicing and Management tool Version: 6.1.7600.16385 - + Image Version: 6.1.7600.16385 - + Packages listing: - + Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0 State : Installed Release Type : Language Pack Install Time : 2/11/2015 11:33 PM - + Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0 State : Installed Release Type : Language Pack Install Time : 2/11/2015 11:33 PM - + Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0 State : Installed Release Type : Feature Pack Install Time : 11/21/2010 3:40 AM - + The operation completed successfully. EOF get_packages_obj = double(stdout: get_packages_stdout) diff --git a/spec/unit/provider/package/pacman_spec.rb b/spec/unit/provider/package/pacman_spec.rb index a07c3b236d..10bb3492b2 100644 --- a/spec/unit/provider/package/pacman_spec.rb +++ b/spec/unit/provider/package/pacman_spec.rb @@ -106,16 +106,16 @@ PACMAN [options] HoldPkg = pacman glibc Architecture = auto - + [customrepo] Server = https://my.custom.repo - + [core] Include = /etc/pacman.d/mirrorlist - + [extra] Include = /etc/pacman.d/mirrorlist - + [community] Include = /etc/pacman.d/mirrorlist PACMAN_CONF diff --git a/spec/unit/provider/package/portage_spec.rb b/spec/unit/provider/package/portage_spec.rb index 08d80d3a7d..e1036bea74 100644 --- a/spec/unit/provider/package/portage_spec.rb +++ b/spec/unit/provider/package/portage_spec.rb @@ -136,7 +136,7 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do You specified an unqualified atom that matched multiple packages: * app-misc/sphinx * dev-python/sphinx - + Please use a more specific atom. EOF status = double(stdout: "", stderr: stderr_output, exitstatus: 1) diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index 0c4942f319..fe8b129a73 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -618,7 +618,7 @@ describe Chef::ResourceReporter do @error = Net::HTTPServerException.new("404 message", @response) expect(@rest_client).to receive(:post) .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, - start_time: @start_time.to_s }, + start_time: @start_time.to_s }, { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) .and_raise(@error) end |