From c87dfdc9cdb43af760ee7af6e96cb4ca5ee577af Mon Sep 17 00:00:00 2001 From: Mark John Merin Date: Fri, 4 Mar 2022 15:07:50 -0800 Subject: [PATCH] cookstyle --- libraries/plist.rb | 5 ++--- spec/unit/libraries/plist_spec.rb | 6 +++--- spec/unit/resources/xcode_spec.rb | 2 +- test/cookbooks/macos_test/recipes/delete_users.rb | 3 ++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/plist.rb b/libraries/plist.rb index 731856a..8b6c505 100644 --- a/libraries/plist.rb +++ b/libraries/plist.rb @@ -25,7 +25,6 @@ module MacOS end def convert_array_to_string(value) - end def convert_to_string_from_data_type(value) @@ -39,11 +38,11 @@ module MacOS when TrueClass "-bool #{value}" when Hash - "-dict #{value.map { |key,value| Shellwords.shellescape(key) + ' ' + convert_to_string_from_data_type(value)}.join(' ')}" + "-dict #{value.map { |key, value| Shellwords.shellescape(key) + ' ' + convert_to_string_from_data_type(value) }.join(' ')}" when String "-string #{Shellwords.shellescape(value)}" when Float - "-float #{value}" + "-float #{value}" else raise "Unknown or unsupported data type: #{value} of #{value.class}" end diff --git a/spec/unit/libraries/plist_spec.rb b/spec/unit/libraries/plist_spec.rb index f97a5c8..73df584 100644 --- a/spec/unit/libraries/plist_spec.rb +++ b/spec/unit/libraries/plist_spec.rb @@ -147,15 +147,15 @@ describe MacOS::PlistHelpers, '#convert_to_string_from_data_type' do end it 'returns the required dictionary entry' do - expect(convert_to_string_from_data_type({'a' => 'b', 'c' => 'd'})).to eq '-dict a -string b c -string d' + expect(convert_to_string_from_data_type({ 'a' => 'b', 'c' => 'd' })).to eq '-dict a -string b c -string d' end it 'returns the required dictionary entry with embedded quotes and numbers' do - expect(convert_to_string_from_data_type({'a' => 3, 'c' => '"d"'})).to eq '-dict a -integer 3 c -string \"d\"' + expect(convert_to_string_from_data_type({ 'a' => 3, 'c' => '"d"' })).to eq '-dict a -integer 3 c -string \"d\"' end it 'returns the required array entry' do - expect(convert_to_string_from_data_type(['a', 'b', 'c'])).to eq '-array -string a -string b -string c' + expect(convert_to_string_from_data_type(%w(a b c))).to eq '-array -string a -string b -string c' end it 'returns the required array entry with embedded quotes' do diff --git a/spec/unit/resources/xcode_spec.rb b/spec/unit/resources/xcode_spec.rb index 902652f..58f6747 100644 --- a/spec/unit/resources/xcode_spec.rb +++ b/spec/unit/resources/xcode_spec.rb @@ -16,7 +16,7 @@ describe 'xcode' do '4.3.2 for Lion', '4.3.3 for Lion', '4.4', - '4.4.1', + '4.4.1', '4.5', '4.5.1', '4.5.2', diff --git a/test/cookbooks/macos_test/recipes/delete_users.rb b/test/cookbooks/macos_test/recipes/delete_users.rb index dbec16c..4a1d819 100644 --- a/test/cookbooks/macos_test/recipes/delete_users.rb +++ b/test/cookbooks/macos_test/recipes/delete_users.rb @@ -3,7 +3,8 @@ user_home = File.join('/', 'Users', user) if Gem::Version.new(node['platform_version']) >= Gem::Version.new('10.13') admin_credentials = ['-adminUser', node['macos']['admin_user'], '-adminPassword', node['macos']['admin_password']] -else '' +else + '' end execute "add user #{user}" do