diff options
author | skippy <jonathan.yates.jones@gmail.com> | 2019-11-17 17:45:15 +0000 |
---|---|---|
committer | skippy <jonathan.yates.jones@gmail.com> | 2019-11-17 17:45:15 +0000 |
commit | b2a69fa7f4461ccf2000bfeea05ed98ab995fa7d (patch) | |
tree | 43209faa52b7780e88ff09b109f7897013713c23 | |
parent | 37c52233266920f457e5053607cec6d13e66144c (diff) | |
download | chef-b2a69fa7f4461ccf2000bfeea05ed98ab995fa7d.tar.gz |
Resolved all chefstyle failures
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 | 28 | ||||
-rwxr-xr-x | tasks/docs.rb | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/lib/chef/provider/user/linux.rb b/lib/chef/provider/user/linux.rb index 529d8806d3..0f68074c9f 100644 --- a/lib/chef/provider/user/linux.rb +++ b/lib/chef/provider/user/linux.rb @@ -67,7 +67,7 @@ class Chef end end ret_codes - end + end def usermod_options opts = [] 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 a5b96af703..e54d192372 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -160,7 +160,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-d", "/Users/mud", "-m", "adam"]) - command.concat([{:returns=>[0]}]) + command.concat([ { returns: [0] } ]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.create_user end @@ -182,7 +182,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-u", "1000", "-r", "-m", "adam"]) - command.concat([{:returns=>[0]}]) + command.concat([ { returns: [0] } ]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.create_user end @@ -192,11 +192,11 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option end describe "when managing a user" do - let(:passwd_s_status) do - double("Mixlib::ShellOut command", exitstatus: 0, stdout: @stdout, stderr: @stderr, error!: nil) + let(:passwd_s_status) do + double("Mixlib::ShellOut command", exitstatus: 0, stdout: @stdout, stderr: @stderr, error!: nil) end - before(:each) do + before(:each) do provider.new_resource.manage_home true provider.new_resource.home "/Users/mud" provider.new_resource.gid "23" @@ -210,7 +210,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-d", "/Users/mud", "-m", "adam"] - command.concat([{:returns=>[0]}]) + command.concat([ { returns: [0] } ]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.manage_user end @@ -222,7 +222,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "-d", "/Users/mud", "-m", "adam"] - command.concat([{:returns=>[0]}]) + command.concat([ { returns: [0] } ]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.manage_user end @@ -232,7 +232,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option command = ["usermod", "-g", "23", "adam"] - command.concat([{:returns=>[0]}]) + command.concat([ { returns: [0] } ]) expect(provider).to receive(:shell_out_compacted!).with(*command).and_return(true) provider.manage_user end @@ -241,24 +241,24 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when removing a user" do it "should run userdel with the new resources user name" do - expect(provider).to receive(:shell_out_compacted!).with("userdel", @new_resource.username, {:returns=>[0]}).and_return(true) + expect(provider).to receive(:shell_out_compacted!).with("userdel", @new_resource.username, { returns: [0] }).and_return(true) provider.remove_user end it "should run userdel with the new resources user name and -r if manage_home is true" do @new_resource.manage_home true - expect(provider).to receive(:shell_out_compacted!).with("userdel", "-r", @new_resource.username, {:returns=>[0]}).and_return(true) + expect(provider).to receive(:shell_out_compacted!).with("userdel", "-r", @new_resource.username, { returns: [0] }).and_return(true) provider.remove_user end it "should run userdel with the new resources user name if non_unique is true" do - expect(provider).to receive(:shell_out_compacted!).with("userdel", @new_resource.username, {:returns=>[0]}).and_return(true) + expect(provider).to receive(:shell_out_compacted!).with("userdel", @new_resource.username, { returns: [0] }).and_return(true) provider.remove_user end it "should run userdel with the new resources user name and -f if force is true" do @new_resource.force(true) - expect(provider).to receive(:shell_out_compacted!).with("userdel", "-f", @new_resource.username, {:returns=>[0]}).and_return(true) + expect(provider).to receive(:shell_out_compacted!).with("userdel", "-f", @new_resource.username, { returns: [0] }).and_return(true) provider.remove_user end end @@ -344,14 +344,14 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when locking the user" do it "should run usermod -L with the new resources username" do - expect(provider).to receive(:shell_out_compacted!).with("usermod", "-L", @new_resource.username, {:returns=>[0]}) + expect(provider).to receive(:shell_out_compacted!).with("usermod", "-L", @new_resource.username, { returns: [0] }) provider.lock_user end end describe "when unlocking the user" do it "should run usermod -L with the new resources username" do - expect(provider).to receive(:shell_out_compacted!).with("usermod", "-U", @new_resource.username, {:returns=>[0]}) + expect(provider).to receive(:shell_out_compacted!).with("usermod", "-U", @new_resource.username, { returns: [0] }) provider.unlock_user end end diff --git a/tasks/docs.rb b/tasks/docs.rb index 643eaee7a6..c347445c2e 100755 --- a/tasks/docs.rb +++ b/tasks/docs.rb @@ -26,7 +26,7 @@ namespace :docs_site do if default.is_a?(String) # .inspect wraps the value in quotes which we want for strings, but not sentences or symbols as strings - return default.inspect unless default[0] == ":" || default.end_with?('.') + return default.inspect unless default[0] == ":" || default.end_with?(".") end default end |