From 8e1e75da57b3c5d56abc180238440cf4e411d3ae Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 13 Jan 2016 08:07:08 -0800 Subject: yet more lint cops fixes: Lint/AmbiguousOperator Lint/DuplicateMethods --- lib/chef/user_v1.rb | 7 +------ lib/chef/win32/registry.rb | 13 ------------- spec/unit/mixin/securable_spec.rb | 6 +++--- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/lib/chef/user_v1.rb b/lib/chef/user_v1.rb index 077fca50b9..b628c76381 100644 --- a/lib/chef/user_v1.rb +++ b/lib/chef/user_v1.rb @@ -1,6 +1,6 @@ # # Author:: Steven Danna (steve@opscode.com) -# Copyright:: Copyright 2012 Opscode, Inc. +# Copyright:: Copyright 2012-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -93,11 +93,6 @@ class Chef arg, :kind_of => String) end - def password(arg=nil) - set_or_return(:password, - arg, :kind_of => String) - end - def create_key(arg=nil) set_or_return(:create_key, arg, :kind_of => [TrueClass, FalseClass]) diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index 12ad08a965..3c1f62d9b8 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -256,19 +256,6 @@ class Chef end end - def get_type_from_name(val_type) - value = { - :binary => ::Win32::Registry::REG_BINARY, - :string => ::Win32::Registry::REG_SZ, - :multi_string => ::Win32::Registry::REG_MULTI_SZ, - :expand_string => ::Win32::Registry::REG_EXPAND_SZ, - :dword => ::Win32::Registry::REG_DWORD, - :dword_big_endian => ::Win32::Registry::REG_DWORD_BIG_ENDIAN, - :qword => ::Win32::Registry::REG_QWORD - }[val_type] - return value - end - def keys_missing?(key_path) missing_key_arr = key_path.split("\\") missing_key_arr.pop diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb index 714d6dedae..33d5eb2141 100644 --- a/spec/unit/mixin/securable_spec.rb +++ b/spec/unit/mixin/securable_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # # Author:: Mark Mzyk () -# Copyright:: Copyright (c) 2011 Opscode, Inc. +# Copyright:: Copyright (c) 2011-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -227,9 +227,9 @@ describe Chef::Mixin::Securable do expect { @securable.mode 0111 }.not_to raise_error expect { @securable.mode 73 }.not_to raise_error - expect { @securable.mode -01 }.to raise_error(ArgumentError) + expect { @securable.mode(-01) }.to raise_error(ArgumentError) expect { @securable.mode 010000 }.to raise_error(ArgumentError) - expect { @securable.mode -1 }.to raise_error(ArgumentError) + expect { @securable.mode(-1) }.to raise_error(ArgumentError) expect { @securable.mode 4096 }.to raise_error(ArgumentError) end -- cgit v1.2.1