GitLab upgraded to 13.8.0-ee.0 - changelog: https://gitlab.com/gitlab-org/gitlab/blob/master/CHANGELOG-EE.md

Unverified Commit 3f72728f authored by Tim Smith's avatar Tim Smith Committed by GitHub

Simplify how we detect if we're on Linux (#167)

* Simplify how we detect if we're on Linux

Ohai has known this for a long time.
Signed-off-by: default avatarTim Smith <tsmith@chef.io>

* Update specs for linux? helper
Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent 8d60d030
......@@ -164,16 +164,7 @@ class Chef
# @return [Boolean]
#
def linux?(node)
%w(
arch
debian
fedora
gentoo
rhel
slackware
suse
wrlinux
).include?(node['platform_family'])
node['os'] == 'linux'
end
end
......
......@@ -148,33 +148,18 @@ describe Chef::Sugar::PlatformFamily do
end
describe '#linux?' do
it 'returns true when the platform_family is Debian' do
node = { 'platform_family' => 'debian' }
expect(described_class.linux?(node)).to be true
end
it 'returns true when the platform_family is RedHat' do
node = { 'platform_family' => 'rhel' }
expect(described_class.linux?(node)).to be true
end
it 'returns true when the platform_family is wrlinux' do
node = { 'platform_family' => 'wrlinux' }
it 'returns true when the os is Linux' do
node = { 'os' => 'linux' }
expect(described_class.linux?(node)).to be true
end
it 'returns false when the platform_family is Windows' do
node = { 'platform_family' => 'windows' }
expect(described_class.linux?(node)).to be false
end
it 'returns false when the platform_family is OSX' do
node = { 'platform_family' => 'mac_os_x' }
it 'returns false when the os is Windows' do
node = { 'os' => 'windows' }
expect(described_class.linux?(node)).to be false
end
it 'returns false when the platform_family is OpenBSD' do
node = { 'platform_family' => 'openbsd' }
it 'returns false when the os is Windows' do
node = { 'os' => 'darwin' }
expect(described_class.linux?(node)).to be false
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment