summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-06-20 08:58:35 -0700
committersersut <serdar@opscode.com>2013-06-20 09:09:20 -0700
commitb421bf663e1cc2a4057f91eb744734fc289be48d (patch)
treeea33cb86d05b46f16bb3fa07e0f1599a42531eea /spec
parent00e112f3f13ff690937095fcc92b0a2c7b1f8748 (diff)
downloadmixlib-shellout-b421bf663e1cc2a4057f91eb744734fc289be48d.tar.gz
Make windows running as tests more reliable.
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout_spec.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index 0d7e7f6..65723ee 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -419,25 +419,22 @@ describe Mixlib::ShellOut do
# Need to adjust the username and domain if running as local system
# to match how whoami returns the information
- let(:local_system) { (ENV['USERNAME'].downcase == "#{ENV['COMPUTERNAME'].downcase}$") }
- let(:domain) { local_system ? 'nt authority' : ENV['COMPUTERNAME'].downcase }
- let(:user) { local_system ? 'system' : ENV['USERNAME'].downcase }
it "should run as current user" do
- running_user.should eql("#{domain}\\#{user}")
+ running_user.should eql("#{ENV['COMPUTERNAME'].downcase}\\#{ENV['USERNAME'].downcase}")
end
end
context "when user is specified" do
before do
- system("net user #{user} #{password} /add")
+ system("net user #{user} #{password} /add").should == true
end
after do
- system("net user #{user} /delete")
+ system("net user #{user} /delete").should == true
end
let(:user) { 'testuser' }
- let(:password) { 'testpassword' }
+ let(:password) { 'testpass1!' }
let(:options) { { :user => user, :password => password } }
it "should run as specified user" do