Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the darwin platform family #141

Merged
merged 1 commit into from
Aug 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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