diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-08-20 00:40:41 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-20 17:54:25 -0700 |
commit | b0ed8efa0cd738df7c0fdbb2469770166132d579 (patch) | |
tree | b99b89d98e10e44960aeee3484ee6d9b315f4c9b | |
parent | ffbb4ac549aec65e151cbbc04a1c7a07b768b445 (diff) | |
download | chef-b0ed8efa0cd738df7c0fdbb2469770166132d579.tar.gz |
Simplify macos detection in specs to include big surmac_spec
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | spec/spec_helper.rb | 6 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 17 |
2 files changed, 5 insertions, 18 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a80c1c3771..f497350e97 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -141,9 +141,9 @@ RSpec.configure do |config| config.filter_run_excluding windows_only: true unless windows? config.filter_run_excluding not_supported_on_windows: true if windows? - config.filter_run_excluding not_supported_on_macos: true if mac_osx? - config.filter_run_excluding macos_only: true unless mac_osx? - config.filter_run_excluding macos_1014: true unless mac_osx_1014? + config.filter_run_excluding not_supported_on_macos: true if macos? + config.filter_run_excluding macos_only: true unless macos? + config.filter_run_excluding macos_1014: true unless macos_1014? config.filter_run_excluding not_supported_on_aix: true if aix? config.filter_run_excluding not_supported_on_solaris: true if solaris? config.filter_run_excluding not_supported_on_gce: true if gce? diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 2c83287959..6298e4440d 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -95,8 +95,8 @@ def windows_user_right?(right) Chef::ReservedNames::Win32::Security.get_account_right(ENV["USERNAME"]).include?(right) end -def mac_osx_1014? - if mac_osx? +def macos_1014? + if macos? ver = Chef::Version.new(ohai[:platform_version]) return ver.major == 10 && ver.minor == 14 end @@ -104,19 +104,6 @@ def mac_osx_1014? false end -def mac_osx? - if File.exist? "/usr/bin/sw_vers" - result = ShellHelpers.shell_out("/usr/bin/sw_vers") - result.stdout.each_line do |line| - if /^ProductName:\sMac OS X.*$/.match?(line) - return true - end - end - end - - false -end - # detects if the hardware is 64-bit (evaluates to true in "WOW64" mode in a 32-bit app on a 64-bit system) def windows64? windows? && ( ENV["PROCESSOR_ARCHITECTURE"] == "AMD64" || ENV["PROCESSOR_ARCHITEW6432"] == "AMD64" ) |