summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-08-14 10:14:51 -0700
committerGitHub <noreply@github.com>2020-08-14 10:14:51 -0700
commitb9df6856a1eb4688f013ba0449a362f951ab40e5 (patch)
treea0328d73a54771e48153aced0af37c2b770b42b0
parent985c26111718397071ad42b22a77345238c6a510 (diff)
parenta62719b1ab6ea90a6c308daaca11e9b253cc69fb (diff)
downloadchef-b9df6856a1eb4688f013ba0449a362f951ab40e5.tar.gz
Merge pull request #10289 from chef/minor_spec
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/functional/resource/link_spec.rb4
-rw-r--r--spec/support/platform_helpers.rb12
2 files changed, 8 insertions, 8 deletions
diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb
index fc260845e4..22bc6e6121 100644
--- a/spec/functional/resource/link_spec.rb
+++ b/spec/functional/resource/link_spec.rb
@@ -403,7 +403,7 @@ describe Chef::Resource::Link do
it "create errors out" do
if windows?
expect { resource.run_action(:create) }.to raise_error(Errno::EACCES)
- elsif os_x? || solaris? || freebsd? || aix?
+ elsif macos? || solaris? || freebsd? || aix?
expect { resource.run_action(:create) }.to raise_error(Errno::EPERM)
else
expect { resource.run_action(:create) }.to raise_error(Errno::EISDIR)
@@ -606,7 +606,7 @@ describe Chef::Resource::Link do
it "errors out" do
if windows?
expect { resource.run_action(:create) }.to raise_error(Errno::EACCES)
- elsif os_x? || solaris? || freebsd? || aix?
+ elsif macos? || solaris? || freebsd? || aix?
expect { resource.run_action(:create) }.to raise_error(Errno::EPERM)
else
expect { resource.run_action(:create) }.to raise_error(Errno::EISDIR)
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 7e17b75206..05839d40ea 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -134,19 +134,19 @@ def unix?
end
def linux?
- !!(RUBY_PLATFORM =~ /linux/)
+ RUBY_PLATFORM.match?(/linux/)
end
-def os_x?
- !!(RUBY_PLATFORM =~ /darwin/)
+def macos?
+ RUBY_PLATFORM.match?(/darwin/)
end
def solaris?
- !!(RUBY_PLATFORM =~ /solaris/)
+ RUBY_PLATFORM.match?(/solaris/)
end
def freebsd?
- !!(RUBY_PLATFORM =~ /freebsd/)
+ RUBY_PLATFORM.match?(/freebsd/)
end
def intel_64bit?
@@ -182,7 +182,7 @@ def debian_family?
end
def aix?
- !!(RUBY_PLATFORM =~ /aix/)
+ RUBY_PLATFORM.match?(/aix/)
end
def wpar?