From 4ea4442d8a6d761eb630b58bce222164de320f4d Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Thu, 24 Sep 2015 14:05:53 -0700 Subject: make tests pass when run by a domain joined user --- spec/mixlib/shellout_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 1c5ce31..2acdc3b 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -621,7 +621,7 @@ describe Mixlib::ShellOut do end context "when running under Windows", :windows_only do - let(:cmd) { 'whoami.exe' } + let(:cmd) { '%windir%/system32/whoami.exe' } let(:running_user) { shell_cmd.run_command.stdout.strip.downcase } context "when no user is set" do @@ -629,7 +629,7 @@ describe Mixlib::ShellOut do # to match how whoami returns the information it "should run as current user" do - expect(running_user).to eql("#{ENV['COMPUTERNAME'].downcase}\\#{ENV['USERNAME'].downcase}") + expect(running_user).to eql("#{ENV['USERDOMAIN'].downcase}\\#{ENV['USERNAME'].downcase}") end end -- cgit v1.2.1