summaryrefslogtreecommitdiff
path: root/spec/unit/win32/security_spec.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-02-28 14:51:20 -0800
committerTim Smith <tsmith@chef.io>2018-03-02 14:57:31 -0800
commit8f8e43e410d558b03850fc81d8ed11286d8ea1dd (patch)
tree9d161a877d3c7ca95059164787b9e9d0e16c4937 /spec/unit/win32/security_spec.rb
parent6f2c11cb9c7ded1137ce2138573d3d0d41e4c551 (diff)
downloadchef-2k3.tar.gz
Remove support for Windows 20032k3
Windows 2003 is fully end of life at this point and hasn't been supported by Chef for quite a while. EXTENDED support for Windows 2003 ended July 14, 2015. We avoid a good number of WMI queries by removing this support entirely. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/win32/security_spec.rb')
-rw-r--r--spec/unit/win32/security_spec.rb8
1 files changed, 0 insertions, 8 deletions
diff --git a/spec/unit/win32/security_spec.rb b/spec/unit/win32/security_spec.rb
index 6e4441a482..9d98ccdf49 100644
--- a/spec/unit/win32/security_spec.rb
+++ b/spec/unit/win32/security_spec.rb
@@ -65,14 +65,8 @@ describe "Chef::Win32::Security", :windows_only do
end
describe "self.has_admin_privileges?" do
- it "returns true for windows server 2003" do
- allow(Chef::Platform).to receive(:windows_server_2003?).and_return(true)
- expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to be true
- end
-
context "when the user doesn't have admin privileges" do
it "returns false" do
- allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false)
allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_raise("Access is denied.")
expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to be false
end
@@ -80,7 +74,6 @@ describe "Chef::Win32::Security", :windows_only do
context "when open_current_process_token fails with some other error than `Access is Denied`" do
it "raises error" do
- allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false)
allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_raise("boom")
expect { Chef::ReservedNames::Win32::Security.has_admin_privileges? }.to raise_error(Chef::Exceptions::Win32APIError)
end
@@ -88,7 +81,6 @@ describe "Chef::Win32::Security", :windows_only do
context "when the user has admin privileges" do
it "returns true" do
- allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false)
allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token)
token = Chef::ReservedNames::Win32::Security.open_current_process_token
allow(token).to receive_message_chain(:handle, :handle)