summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-20 00:40:41 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-02 14:12:41 -0700
commitae4277185844f86f276ad9211d14d223b361a8e0 (patch)
tree4b2377c97e7435116cb54c08b17eb29d6e4d5258
parentcf8de6c5b07a74e94e8194b484f28c3e2c73d483 (diff)
downloadchef-ae4277185844f86f276ad9211d14d223b361a8e0.tar.gz
Simplify macos detection in specs to include big sur
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/spec_helper.rb6
-rw-r--r--spec/support/platform_helpers.rb29
2 files changed, 5 insertions, 30 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 030d1f9913..035adc40ba 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -139,9 +139,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 2cefbaf567..5b3e586b44 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -100,21 +100,9 @@ def windows_user_right?(right)
Chef::ReservedNames::Win32::Security.get_account_right(ENV["USERNAME"]).include?(right)
end
-def mac_osx_106?
- if File.exists? "/usr/bin/sw_vers"
- result = ShellHelpers.shell_out("/usr/bin/sw_vers")
- result.stdout.each_line do |line|
- if line =~ /^ProductVersion:\s10.6.*$/
- return true
- end
- end
- end
-
- false
-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
@@ -122,19 +110,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 line =~ /^ProductName:\sMac OS X.*$/
- 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" )