summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-08 16:35:34 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-08 16:35:34 -0700
commitb88d9aaa844f2c98d1e49099d9e23e0497667e02 (patch)
treeed850b436da9a0d796141e63f28e9c12d0fe0870 /spec
parent313afa345a0d19019218807a16bf6fdd6447a87b (diff)
downloadchef-b88d9aaa844f2c98d1e49099d9e23e0497667e02.tar.gz
Use include? to example strings when we don't need a regexstrings
There's no need for match? with regex here. Signed-off-by: Tim Smith <tsmith@chef.io>
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?