diff options
Diffstat (limited to 'spec/mixlib/shellout_spec.rb')
-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 |