diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 13:41:00 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 13:41:00 -0700 |
commit | 174a2748b54a5dbd746005e2aead59221b80f2b9 (patch) | |
tree | 55e4bacca96b540526f3c19a00d666e68610ea6e /spec/functional | |
parent | 3b10f9ca503dcbce747241281b9151d3d010f9ef (diff) | |
download | chef-174a2748b54a5dbd746005e2aead59221b80f2b9.tar.gz |
fix 4 cops
- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
EnforcedStyle: consistent
- Layout/BlockEndNewline
the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/event_loggers/windows_eventlog_spec.rb | 10 | ||||
-rw-r--r-- | spec/functional/resource/dsc_resource_spec.rb | 3 | ||||
-rw-r--r-- | spec/functional/resource/group_spec.rb | 14 | ||||
-rw-r--r-- | spec/functional/resource/powershell_script_spec.rb | 3 | ||||
-rw-r--r-- | spec/functional/win32/security_spec.rb | 15 |
5 files changed, 28 insertions, 17 deletions
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb index c1e5150428..ca15d3e38d 100644 --- a/spec/functional/event_loggers/windows_eventlog_spec.rb +++ b/spec/functional/event_loggers/windows_eventlog_spec.rb @@ -49,16 +49,18 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do logger.run_start(version, run_status) expect(event_log.read(flags, offset).any? do |e| - e.source == Chef::Dist::PRODUCT && e.event_id == 10000 && - e.string_inserts[0].include?(version) end).to be_truthy + e.source == Chef::Dist::PRODUCT && e.event_id == 10000 && + e.string_inserts[0].include?(version) + end ).to be_truthy end it "writes run_started event with event_id 10001 and contains the run_id" do logger.run_started(run_status) expect(event_log.read(flags, offset).any? do |e| - e.source == Chef::Dist::PRODUCT && e.event_id == 10001 && - e.string_inserts[0].include?(run_id) end).to be_truthy + e.source == Chef::Dist::PRODUCT && e.event_id == 10001 && + e.string_inserts[0].include?(run_id) + end ).to be_truthy end it "writes run_completed event with event_id 10002 and contains the run_id and elapsed time" do diff --git a/spec/functional/resource/dsc_resource_spec.rb b/spec/functional/resource/dsc_resource_spec.rb index 3491bb6bbe..8f5ba5fd9e 100644 --- a/spec/functional/resource/dsc_resource_spec.rb +++ b/spec/functional/resource/dsc_resource_spec.rb @@ -46,7 +46,8 @@ describe Chef::Resource::DscResource, :windows_powershell_dsc_only do it "raises an exception if the resource is not found" do new_resource.resource "thisdoesnotexist" expect { new_resource.run_action(:run) }.to raise_error( - Chef::Exceptions::ResourceNotFound) + Chef::Exceptions::ResourceNotFound + ) end end diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb index f5bb458666..c17217b1f3 100644 --- a/spec/functional/resource/group_spec.rb +++ b/spec/functional/resource/group_spec.rb @@ -334,9 +334,10 @@ describe Chef::Resource::Group, :requires_root_or_running_windows do describe "when group name is length 256", :windows_only do let!(:group_name) do "theoldmanwalkingdownthestreetalwayshadagood\ -smileonhisfacetheoldmanwalkingdownthestreetalwayshadagoodsmileonhisface\ -theoldmanwalkingdownthestreetalwayshadagoodsmileonhisfacetheoldmanwalking\ -downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestree" end + smileonhisfacetheoldmanwalkingdownthestreetalwayshadagoodsmileonhisface\ + theoldmanwalkingdownthestreetalwayshadagoodsmileonhisfacetheoldmanwalking\ + downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestree" + end it "should create a group" do group_resource.run_action(:create) @@ -360,9 +361,10 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestree" end context "group create action: when group name length is more than 256", :windows_only do let!(:group_name) do "theoldmanwalkingdownthestreetalwayshadagood\ -smileonhisfacetheoldmanwalkingdownthestreetalwayshadagoodsmileonhisface\ -theoldmanwalkingdownthestreetalwayshadagoodsmileonhisfacetheoldmanwalking\ -downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" end + smileonhisfacetheoldmanwalkingdownthestreetalwayshadagoodsmileonhisface\ + theoldmanwalkingdownthestreetalwayshadagoodsmileonhisfacetheoldmanwalking\ + downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" + end it "should not create a group" do expect { group_resource.run_action(:create) }.to raise_error(ArgumentError) diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb index 4473b242c4..74ece0d33c 100644 --- a/spec/functional/resource/powershell_script_spec.rb +++ b/spec/functional/resource/powershell_script_spec.rb @@ -590,7 +590,8 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do resource.only_if "$true", architecture: :i386 expect { resource.run_action(:run) }.to raise_error( Chef::Exceptions::Win32ArchitectureIncorrect, - /cannot execute script with requested architecture 'i386' on Windows Nano Server/) + /cannot execute script with requested architecture 'i386' on Windows Nano Server/ + ) end end end diff --git a/spec/functional/win32/security_spec.rb b/spec/functional/win32/security_spec.rb index c72da9ce6c..a72088a079 100644 --- a/spec/functional/win32/security_spec.rb +++ b/spec/functional/win32/security_spec.rb @@ -61,7 +61,8 @@ describe "Chef::Win32::Security", :windows_only do describe "get_file_security" do it "should return a security descriptor when called with a path that exists" do security_descriptor = Chef::ReservedNames::Win32::Security.get_file_security( - "C:\\Program Files") + "C:\\Program Files" + ) # Make sure the security descriptor works expect(security_descriptor.dacl_present?).to be true end @@ -70,7 +71,8 @@ describe "Chef::Win32::Security", :windows_only do describe "access_check" do let(:security_descriptor) do Chef::ReservedNames::Win32::Security.get_file_security( - "C:\\Program Files") + "C:\\Program Files" + ) end let(:token_rights) { Chef::ReservedNames::Win32::Security::TOKEN_ALL_ACCESS } @@ -78,7 +80,8 @@ describe "Chef::Win32::Security", :windows_only do let(:token) do Chef::ReservedNames::Win32::Security.open_process_token( Chef::ReservedNames::Win32::Process.get_current_process, - token_rights).duplicate_token(:SecurityImpersonation) + token_rights + ).duplicate_token(:SecurityImpersonation) end let(:mapping) do @@ -102,7 +105,8 @@ describe "Chef::Win32::Security", :windows_only do let(:token) do Chef::ReservedNames::Win32::Security.open_process_token( Chef::ReservedNames::Win32::Process.get_current_process, - token_rights) + token_rights + ) end context "with all rights" do let(:token_rights) { Chef::ReservedNames::Win32::Security::TOKEN_ALL_ACCESS } @@ -127,7 +131,8 @@ describe "Chef::Win32::Security", :windows_only do let(:token) do Chef::ReservedNames::Win32::Security.open_process_token( Chef::ReservedNames::Win32::Process.get_current_process, - token_rights) + token_rights + ) end context "when the token is valid" do |