diff options
Diffstat (limited to 'spec/unit/resource/powershell_script_spec.rb')
-rw-r--r-- | spec/unit/resource/powershell_script_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/resource/powershell_script_spec.rb b/spec/unit/resource/powershell_script_spec.rb index 3cb5e1b5a9..f1a9215caa 100644 --- a/spec/unit/resource/powershell_script_spec.rb +++ b/spec/unit/resource/powershell_script_spec.rb @@ -49,7 +49,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 +61,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 +87,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 +98,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) |