summaryrefslogtreecommitdiff
path: root/spec/support/platform_helpers.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-09 17:16:46 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-09 17:16:46 -0700
commit13d257e967c42822106c99ebdacf0b5514cdb2f0 (patch)
tree9b592561c944b1b7a30a82699accccd424c1f61a /spec/support/platform_helpers.rb
parenta18ae8ff2472ca4f678580ac59903b752b0a5ced (diff)
downloadchef-13d257e967c42822106c99ebdacf0b5514cdb2f0.tar.gz
Dont run useradd_spec on osxjdm/osx
Diffstat (limited to 'spec/support/platform_helpers.rb')
-rw-r--r--spec/support/platform_helpers.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index a412fe38e1..da0313758b 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -88,6 +88,20 @@ def mac_osx_106?
false
end
+def mac_osx?
+ if File.exists? "/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' )