diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-04 08:35:04 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-04 08:35:04 -0800 |
commit | 938c37c2dd5bff3b888540ae1ae4d2e51b3208d8 (patch) | |
tree | 2ee587d74840857a1aaffc09692781d64ebd85ef /spec/unit/resource/powershell_script_spec.rb | |
parent | dfeb0a2f8888ea8e1f1860e3da7ad7a1a4dac56f (diff) | |
download | chef-lcg/whitespace-style.tar.gz |
whitespace fixeslcg/whitespace-style
5533 Style/SpaceInsideHashLiteralBraces
2619 Style/SpaceAroundOperators
2288 Style/EmptyLinesAroundBlockBody
2012 Style/SpaceInsideBlockBraces
1444 Style/AlignHash
1395 Style/SpaceAfterComma
1382 Style/SpaceAroundEqualsInParameterDefault
800 Style/EmptyLinesAroundClassBody
396 Style/IndentationConsistency
354 Style/ExtraSpacing
310 Style/SpaceBeforeBlockBraces
309 Style/EmptyLines
304 Style/TrailingWhitespace
241 Style/MultilineOperationIndentation
230 Style/TrailingBlankLines
219 Style/EmptyLinesAroundModuleBody
212 Style/IndentHash
147 Style/IndentationWidth
120 Style/EmptyLineBetweenDefs
107 Style/SpaceAroundBlockParameters
63 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
Diffstat (limited to 'spec/unit/resource/powershell_script_spec.rb')
-rw-r--r-- | spec/unit/resource/powershell_script_spec.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/spec/unit/resource/powershell_script_spec.rb b/spec/unit/resource/powershell_script_spec.rb index 3cb5e1b5a9..e7176423a4 100644 --- a/spec/unit/resource/powershell_script_spec.rb +++ b/spec/unit/resource/powershell_script_spec.rb @@ -19,7 +19,6 @@ require "spec_helper" describe Chef::Resource::PowershellScript do - before(:each) do node = Chef::Node.new @@ -49,7 +48,7 @@ describe Chef::Resource::PowershellScript do it "raises an error when architecture is i386 on Windows Nano Server" do allow(Chef::Platform).to receive(:windows_nano_server?).and_return(true) - expect{@resource.architecture(:i386)}.to raise_error(Chef::Exceptions::Win32ArchitectureIncorrect, "cannot execute script with requested architecture 'i386' on Windows Nano Server") + expect { @resource.architecture(:i386) }.to raise_error(Chef::Exceptions::Win32ArchitectureIncorrect, "cannot execute script with requested architecture 'i386' on Windows Nano Server") end context "when using guards" do @@ -61,7 +60,7 @@ describe Chef::Resource::PowershellScript do it "inherits exactly the :cwd, :environment, :group, :path, :user, :umask, and :architecture attributes from a parent resource class" do inherited_difference = Chef::Resource::PowershellScript.guard_inherited_attributes - - [:cwd, :environment, :group, :path, :user, :umask, :architecture ] + [:cwd, :environment, :group, :path, :user, :umask, :architecture ] expect(inherited_difference).to eq([]) end @@ -87,7 +86,7 @@ describe Chef::Resource::PowershellScript do it "enables convert_boolean_return by default for guards in the context of powershell_script when no guard params are specified" do allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(true) allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with( - {:convert_boolean_return => true, :code => "$true"}).and_return(Proc.new {}) + { :convert_boolean_return => true, :code => "$true" }).and_return(Proc.new {}) resource.only_if("$true") end @@ -98,27 +97,27 @@ describe Chef::Resource::PowershellScript do file_resource.guard_interpreter :powershell_script allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with( - {:convert_boolean_return => true, :code => "$true"}).and_return(Proc.new {}) + { :convert_boolean_return => true, :code => "$true" }).and_return(Proc.new {}) resource.only_if("$true") end it "enables convert_boolean_return by default for guards in the context of powershell_script when guard params are specified" do - guard_parameters = {:cwd => "/etc/chef", :architecture => :x86_64} + guard_parameters = { :cwd => "/etc/chef", :architecture => :x86_64 } allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with( - {:convert_boolean_return => true, :code => "$true"}.merge(guard_parameters)).and_return(Proc.new {}) + { :convert_boolean_return => true, :code => "$true" }.merge(guard_parameters)).and_return(Proc.new {}) resource.only_if("$true", guard_parameters) end it "passes convert_boolean_return as true if it was specified as true in a guard parameter" do - guard_parameters = {:cwd => "/etc/chef", :convert_boolean_return => true, :architecture => :x86_64} + guard_parameters = { :cwd => "/etc/chef", :convert_boolean_return => true, :architecture => :x86_64 } allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with( - {:convert_boolean_return => true, :code => "$true"}.merge(guard_parameters)).and_return(Proc.new {}) + { :convert_boolean_return => true, :code => "$true" }.merge(guard_parameters)).and_return(Proc.new {}) resource.only_if("$true", guard_parameters) end it "passes convert_boolean_return as false if it was specified as true in a guard parameter" do - other_guard_parameters = {:cwd => "/etc/chef", :architecture => :x86_64} - parameters_with_boolean_disabled = other_guard_parameters.merge({:convert_boolean_return => false, :code => "$true"}) + other_guard_parameters = { :cwd => "/etc/chef", :architecture => :x86_64 } + parameters_with_boolean_disabled = other_guard_parameters.merge({ :convert_boolean_return => false, :code => "$true" }) allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:block_from_attributes).with( parameters_with_boolean_disabled).and_return(Proc.new {}) resource.only_if("$true", parameters_with_boolean_disabled) |