diff --git a/lib/train/extras/os_common.rb b/lib/train/extras/os_common.rb index e2058e76..b126f523 100644 --- a/lib/train/extras/os_common.rb +++ b/lib/train/extras/os_common.rb @@ -60,6 +60,9 @@ def to_hash 'esx' => %w{ esx }, + 'darwin' => %w{ + darwin + }, } OS['linux'] = %w{linux alpine arch coreos exherbo gentoo slackware fedora amazon} + OS['redhat'] + OS['debian'] + OS['suse'] diff --git a/test/unit/extras/os_common_test.rb b/test/unit/extras/os_common_test.rb index 6a7f8f4d..a0e8ac7a 100644 --- a/test/unit/extras/os_common_test.rb +++ b/test/unit/extras/os_common_test.rb @@ -286,4 +286,14 @@ def mock_platform(x) it { os.esx?.must_equal(true) } end + describe 'with platform set to darwin' do + let(:os) { mock_platform('darwin') } + it { os.solaris?.must_equal(false) } + it { os.linux?.must_equal(false) } + it {os[:family].must_equal('darwin')} + it { os.unix?.must_equal(true) } + it { os.bsd?.must_equal(true) } + it { os.esx?.must_equal(false) } + end + end