summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2015-10-02 15:14:29 -0700
committerClaire McQuin <claire@getchef.com>2015-10-05 10:00:07 -0700
commite413ea35bba2ad36453b3d428c343ab3f0bce23a (patch)
tree2114f4b54a99337f67e66b46f7f172d49c6a5313 /spec/support
parent69cf21c8b35d7fb94775db377e810908e5fad54a (diff)
downloadchef-e413ea35bba2ad36453b3d428c343ab3f0bce23a.tar.gz
Raise error when running 32-bit scripts on Windows Nano.mcquin/nano/disable-32-bit
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared/functional/windows_script.rb14
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