diff options
author | Stuart Preston <stuart@chef.io> | 2018-07-09 15:54:32 +0100 |
---|---|---|
committer | Stuart Preston <stuart@chef.io> | 2018-07-09 15:54:32 +0100 |
commit | 10206f8db5151da7a2ab2250e217e4b3a570a4f5 (patch) | |
tree | fd943dd81ca829f40cad8e296b002a32ed5c78a1 | |
parent | 6c339ac29bed1df08ce9498c67698106b24a835c (diff) | |
download | chef-10206f8db5151da7a2ab2250e217e4b3a570a4f5.tar.gz |
Addressing Chefstyle issues, adding author
Signed-off-by: Stuart Preston <stuart@chef.io>
-rw-r--r-- | spec/functional/resource/user/windows_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/functional/resource/user/windows_spec.rb b/spec/functional/resource/user/windows_spec.rb index 47e2f7efb1..bfa1cc6367 100644 --- a/spec/functional/resource/user/windows_spec.rb +++ b/spec/functional/resource/user/windows_spec.rb @@ -1,5 +1,7 @@ # Author:: Jay Mundrawala (<jdm@chef.io>) -# Copyright:: Copyright 2015-2016, Chef Software +# Author:: Stuart Preston (<stuart@chef.io>) +# +# Copyright:: Copyright 2015-2018, Chef Software # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,12 +46,12 @@ describe Chef::Provider::User::Windows, :windows_only do shell_out("net user #{u} /delete") end - def backup_secedit_policy() + def backup_secedit_policy backup_command = "secedit /export /cfg #{ENV['TEMP']}\\secedit_restore.inf /areas SECURITYPOLICY /quiet" system(backup_command) end - def restore_secedit_policy() + def restore_secedit_policy security_database = "C:\\windows\\security\\database\\seceditnew.sdb" restore_command = "secedit /configure /db #{security_database} /cfg #{ENV['TEMP']}\\secedit_restore.inf /areas SECURITYPOLICY /quiet" system(restore_command) @@ -63,7 +65,7 @@ describe Chef::Provider::User::Windows, :windows_only do [Unicode] Unicode=yes [System Access] - MinimumPasswordLength = #{minimum_password_length.to_s} + MinimumPasswordLength = #{minimum_password_length} [Version] signature="$CHICAGO$" Revision=1 @@ -119,7 +121,7 @@ describe Chef::Provider::User::Windows, :windows_only do context "when a username and empty password are given" do it "does not create the specified user" do new_resource.password("") - expect{ new_resource.run_action(:create) }.to raise_exception(Chef::Exceptions::Win32APIError, /The password does not meet the password policy requirements/) + expect { new_resource.run_action(:create) }.to raise_exception(Chef::Exceptions::Win32APIError, /The password does not meet the password policy requirements/) end end end |