diff options
author | NimishaS <nimisha.sharad@msystechnologies.com> | 2017-07-07 10:20:46 +0000 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2017-07-19 15:29:15 -0400 |
commit | cb07cc92ec9f5bc5f390bbb2553105525cf18869 (patch) | |
tree | 139098bf2cbef3bec4b6da4af711682db51154da /spec | |
parent | 2d3ca5cd7bfc119b463eaf3b331296c2e370c2de (diff) | |
download | mixlib-shellout-cb07cc92ec9f5bc5f390bbb2553105525cf18869.tar.gz |
Launch process with elevated token
Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index a55b3c0..15bfa39 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -655,6 +655,14 @@ describe Mixlib::ShellOut do it "should run as specified user" do expect(running_user).to eql("#{ENV['COMPUTERNAME'].downcase}\\#{user}") end + + context "when :elevated => true" do + let(:options) { { :user => user, :password => password, :elevated => true } } + + it "raises error" do + expect { running_user }.to raise_error("Logon failure: the user has not been granted the requested logon type at this computer. - LogonUserW (You must hold `Log on as a service` and `Log on as a batch job` permissions.)") + end + end end end |