diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-11 13:24:24 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2015-02-17 09:24:44 -0500 |
commit | a0e367d816e869bb13513a8cb95e90ae85899a4f (patch) | |
tree | 4fdcf5c8383fb522fd25961b70efd51a4cc6b37d | |
parent | a5882a989a13cfb9097b337ec560fa771160fcfc (diff) | |
download | chef-a0e367d816e869bb13513a8cb95e90ae85899a4f.tar.gz |
Added a test for duplicating a security token with incorrect permissions
-rw-r--r-- | spec/functional/win32/security_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/functional/win32/security_spec.rb b/spec/functional/win32/security_spec.rb index 7ad6756a20..8c3db8e2d2 100644 --- a/spec/functional/win32/security_spec.rb +++ b/spec/functional/win32/security_spec.rb @@ -48,5 +48,13 @@ describe 'Chef::Win32::Security', :windows_only do expect{ token.duplicate_token(:SecurityImpersonation) }.not_to raise_error end end + + context 'with read only rights' do + let(:token_rights) { Chef::ReservedNames::Win32::Security::TOKEN_READ } + + it 'raises an exception when trying to duplicate' do + expect{ token.duplicate_token(:SecurityImpersonation) }.to raise_error(Chef::Exceptions::Win32APIError) + end + end end end |