diff options
author | skippy <jonathan.yates.jones@gmail.com> | 2019-11-17 06:50:51 +0000 |
---|---|---|
committer | skippy <jonathan.yates.jones@gmail.com> | 2019-11-17 06:50:51 +0000 |
commit | 8d69df6f0bbfc08a17bdd7af5f17aff345203274 (patch) | |
tree | 3798e009ecbeff93635d05f8971ec3edf6655f75 | |
parent | ec4547ebe04dd910ecedc6193cbf53e38f05d4cd (diff) | |
download | chef-8d69df6f0bbfc08a17bdd7af5f17aff345203274.tar.gz |
Resolved issues with tests not receiving exactly what they expected.
Resolved new method in linux_user not returning the correct array.
Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
-rw-r--r-- | lib/chef/provider/user/linux.rb | 2 | ||||
-rw-r--r-- | spec/support/shared/unit/provider/useradd_based_user_provider.rb | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/provider/user/linux.rb b/lib/chef/provider/user/linux.rb index 9c49f4c31d..7e10957717 100644 --- a/lib/chef/provider/user/linux.rb +++ b/lib/chef/provider/user/linux.rb @@ -62,7 +62,7 @@ class Chef if new_resource.manage_home home_dir_exist = shell_out!("test", "-d", new_resource.home, returns: [1]) if home_dir_exist.error? - opts << 12 + ret_codes << 12 end end end diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb index a30f543e72..997d7350be 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -159,7 +159,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-u", "1000", "-d", "/Users/mud", "-m", - "adam" ]) + "adam", {:returns=>[0,12]}]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.create_user end @@ -180,7 +180,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option command.concat([ "-s", "/usr/bin/zsh", "-u", "1000", "-r", "-m", - "adam" ]) + "adam", {:returns=>[0]} ]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.create_user end @@ -203,7 +203,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-g", "23", "-d", "/Users/mud", "-m", - "adam" ] + "adam", {:returns=>[0,12]}] expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.manage_user end @@ -214,7 +214,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-g", "23", "-d", "/Users/mud", "-m", - "adam" ] + "adam", {:returns=>[0]}] expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.manage_user end @@ -223,7 +223,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option expect(provider).to receive(:updating_home?).at_least(:once).and_return(false) command = ["usermod", "-g", "23", - "adam" ] + "adam", {:returns=>[0]} ] expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.manage_user end |