Skip to content

Commit

Permalink
Merge pull request #141 from chef/darwin
Browse files Browse the repository at this point in the history
Add the darwin platform family
  • Loading branch information
chris-rock authored Aug 23, 2016
2 parents ef4ea19 + 1a16a77 commit 2eff9fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/train/extras/os_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
10 changes: 10 additions & 0 deletions test/unit/extras/os_common_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2eff9fb

Please sign in to comment.