summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-09-08 19:01:12 -0700
committerGitHub <noreply@github.com>2020-09-08 19:01:12 -0700
commit80b2115913042a65ceceff72cd5ab3faa7bdc7f4 (patch)
tree489685eaf96b2465b1992b04e2469efcaa28696e /spec
parent8cac887c99a5f5c24ea02d52c70fd951c7b3a09a (diff)
parentb88d9aaa844f2c98d1e49099d9e23e0497667e02 (diff)
downloadchef-80b2115913042a65ceceff72cd5ab3faa7bdc7f4.tar.gz
Merge pull request #10396 from chef/strings
Use include? to example strings when we don't need a regex
Diffstat (limited to 'spec')
-rw-r--r--spec/support/platform_helpers.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index d4bd0701d8..51a9299497 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -26,11 +26,11 @@ class DependencyProc < Proc
end
def ruby_64bit?
- !!(RbConfig::CONFIG["host_cpu"] =~ /x86_64/)
+ RbConfig::CONFIG["host_cpu"].include?("x86_64")
end
def ruby_32bit?
- !!(RbConfig::CONFIG["host_cpu"] =~ /i686/)
+ RbConfig::CONFIG["host_cpu"].include?("i686")
end
def windows?
@@ -117,19 +117,19 @@ def unix?
end
def linux?
- RUBY_PLATFORM.match?(/linux/)
+ RUBY_PLATFORM.include?("linux")
end
def macos?
- RUBY_PLATFORM.match?(/darwin/)
+ RUBY_PLATFORM.include?("darwin")
end
def solaris?
- RUBY_PLATFORM.match?(/solaris/)
+ RUBY_PLATFORM.include?("solaris")
end
def freebsd?
- RUBY_PLATFORM.match?(/freebsd/)
+ RUBY_PLATFORM.include?("freebsd")
end
def intel_64bit?
@@ -165,7 +165,7 @@ def debian_family?
end
def aix?
- RUBY_PLATFORM.match?(/aix/)
+ RUBY_PLATFORM.include?("aix")
end
def wpar?
@@ -199,8 +199,7 @@ def selinux_enabled?
end
def suse?
- ::File.exist?("/etc/SuSE-release") ||
- ( ::File.exist?("/etc/os-release") && /sles|suse/.match?(File.read("/etc/os-release")) )
+ !!(ohai[:platform_family] == "suse")
end
def root?