move darwin to bsd type

see: https://en.wikipedia.org/wiki/Darwin_%28operating_system%29#/media/File:Unix_timeline.en.svg
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-28 12:14:40 +02:00
parent 4f0c0d7f21
commit 4e15e425a4
2 changed files with 9 additions and 2 deletions

View file

@ -39,7 +39,7 @@ class Vulcano::Plugins::Backend
suse opensuse
},
'bsd' => %w{
freebsd netbsd openbsd
freebsd netbsd openbsd darwin
},
'solaris' => %w{
solaris smartos openindiana opensolaris solaris2 nexentacore
@ -49,7 +49,7 @@ class Vulcano::Plugins::Backend
OS['linux'] = %w{alpine arch coreos exherbo gentoo slackware} +
OS['redhat'] + OS['debian'] + OS['suse']
OS['unix'] = %w{unix aix darwin} + OS['linux'] + OS['solaris'] + OS['bsd']
OS['unix'] = %w{unix aix} + OS['linux'] + OS['solaris'] + OS['bsd']
# Helper methods to check the OS type
# Provides methods in the form of: linux?, unix?, solaris? ...

View file

@ -179,6 +179,13 @@ describe 'Vulcano::Plugins::Backend::OSCommon' do
it { osc.unix?.must_equal(true) }
end
describe 'with platform set to darwin' do
before { set_platform(osc, 'darwin') }
it { osc.bsd?.must_equal(true) }
it { osc.linux?.must_equal(false) }
it { osc.unix?.must_equal(true) }
end
describe 'with platform set to solaris' do
before { set_platform(osc, 'solaris') }
it { osc.solaris?.must_equal(true) }