diff options
Diffstat (limited to 'spec/support/shared/functional/windows_script.rb')
-rw-r--r-- | spec/support/shared/functional/windows_script.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/support/shared/functional/windows_script.rb b/spec/support/shared/functional/windows_script.rb index b6fc2a98ad..70fb2d8578 100644 --- a/spec/support/shared/functional/windows_script.rb +++ b/spec/support/shared/functional/windows_script.rb @@ -103,16 +103,24 @@ shared_context Chef::Resource::WindowsScript do end end - context "when the guard's architecture is specified as 32-bit" do + context "when the guard's architecture is specified as 32-bit", :not_supported_on_nano do let (:guard_architecture) { :i386 } it "executes a 32-bit guard" do - pending "executing scripts with a 32-bit process should raise an error on nano" if Chef::Platform.windows_nano_server? - resource.only_if resource_guard_command, :architecture => guard_architecture resource.run_action(:run) expect(get_guard_process_architecture).to eq('x86') end end + + context "when the guard's architecture is specified as 32-bit", :windows_nano_only do + let (:guard_architecture) { :i386 } + it "raises an error" do + resource.only_if resource_guard_command, :architecture => guard_architecture + expect{ resource.run_action(:run) }.to raise_error( + Chef::Exceptions::Win32ArchitectureIncorrect, + /cannot execute script with requested architecture 'i386' on Windows Nano Server/) + end + end end end |