summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-09-09 20:41:39 -0700
committerGitHub <noreply@github.com>2019-09-09 20:41:39 -0700
commitaa401a2f19e656bf902919a070276f0d89d387d9 (patch)
tree9095a85fa235bb5ef29d921f9749b101866c92d4 /spec/support
parent790720631c797499218c361bb9d85724eeaf78a7 (diff)
parent96802f1f07d205b82629cfe6fbfd466b3a153ab8 (diff)
downloadchef-aa401a2f19e656bf902919a070276f0d89d387d9.tar.gz
Merge pull request #8775 from chef/ryancragun/mac_user
Add mac_user resource that is compatible with macOS >= 10.14
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/platform_helpers.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 0b13169ac1..3ac657d84e 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -3,6 +3,7 @@ require "chef/mixin/shell_out"
require "ohai/mixin/http_helper"
require "ohai/mixin/gce_metadata"
require "chef/mixin/powershell_out"
+require "chef/version_class"
class ShellHelpers
extend Chef::Mixin::ShellOut
@@ -110,6 +111,15 @@ def mac_osx_106?
false
end
+def mac_osx_1014?
+ if mac_osx?
+ ver = Chef::Version.new(ohai[:platform_version])
+ return ver.major == 10 && ver.minor == 14
+ end
+
+ false
+end
+
def mac_osx?
if File.exists? "/usr/bin/sw_vers"
result = ShellHelpers.shell_out("/usr/bin/sw_vers")