diff options
author | Salim Alam <salam@chef.io> | 2015-08-13 14:25:48 -0700 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2015-08-19 11:08:17 -0700 |
commit | 6c4cd5c6d5c40baca723bf95cdbccdda59021198 (patch) | |
tree | f2d6357705440c11467b46c60eac0b4c5ddb871e /spec/functional | |
parent | fe6676bab51390429674b0ecd4670924ffb09cc5 (diff) | |
download | chef-6c4cd5c6d5c40baca723bf95cdbccdda59021198.tar.gz |
Enable 64-bit support for Powershell and Batch scripts
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/resource/powershell_script_spec.rb | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb index a8e51f4d9d..2e8abedac5 100644 --- a/spec/functional/resource/powershell_script_spec.rb +++ b/spec/functional/resource/powershell_script_spec.rb @@ -229,8 +229,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do end - context "when running on a 32-bit version of Windows", :windows32_only do - + context "when running on a 32-bit version of Ruby", :ruby32_only do it "executes a script with a 32-bit process if process architecture :i386 is specified" do resource.code(processor_architecture_script_content + " | out-file -encoding ASCII #{script_output_path}") resource.architecture(:i386) @@ -240,15 +239,28 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do expect(source_contains_case_insensitive_content?( get_script_output, 'x86' )).to eq(true) end - it "raises an exception if :x86_64 process architecture is specified" do - begin - expect(resource.architecture(:x86_64)).to raise_error Chef::Exceptions::Win32ArchitectureIncorrect - rescue Chef::Exceptions::Win32ArchitectureIncorrect + context "when running on a 64-bit version of Windows", :windows64_only do + it "executes a script with a 64-bit process if :x86_64 arch is specified" do + resource.code(processor_architecture_script_content + " | out-file -encoding ASCII #{script_output_path}") + resource.architecture(:x86_64) + resource.returns(0) + resource.run_action(:run) + + expect(source_contains_case_insensitive_content?( get_script_output, 'AMD64' )).to eq(true) + end + end + + context "when running on a 32-bit version of Windows", :windows32_only do + it "raises an exception if :x86_64 process architecture is specified" do + begin + expect(resource.architecture(:x86_64)).to raise_error Chef::Exceptions::Win32ArchitectureIncorrect + rescue Chef::Exceptions::Win32ArchitectureIncorrect + end end end end - context "when running on a 64-bit version of Windows", :windows64_only do + context "when running on a 64-bit version of Ruby", :ruby64_only do it "executes a script with a 64-bit process if :x86_64 arch is specified" do resource.code(processor_architecture_script_content + " | out-file -encoding ASCII #{script_output_path}") resource.architecture(:x86_64) |