diff options
author | sersut <serdar@opscode.com> | 2013-06-20 08:58:35 -0700 |
---|---|---|
committer | sersut <serdar@opscode.com> | 2013-06-20 09:09:20 -0700 |
commit | b421bf663e1cc2a4057f91eb744734fc289be48d (patch) | |
tree | ea33cb86d05b46f16bb3fa07e0f1599a42531eea /spec | |
parent | 00e112f3f13ff690937095fcc92b0a2c7b1f8748 (diff) | |
download | chef-b421bf663e1cc2a4057f91eb744734fc289be48d.tar.gz |
Make windows running as tests more reliable.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 0d7e7f6267..65723eefed 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 |