This repository has been archived by the owner on Apr 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from chef-cookbooks/hard_fail
Hard fail on unsupported platforms
- Loading branch information
Showing
5 changed files
with
61 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,49 @@ | ||
require 'spec_helper' | ||
|
||
describe 'omnibus_updater::default' do | ||
let(:chef_run) do | ||
ChefSpec::ServerRunner.new(platform: 'redhat', version: '7.0') do |node, server| | ||
end.converge(described_recipe) | ||
describe 'omnibus_updater::default on unsupported platform' do | ||
cached(:chef_run) do | ||
ChefSpec::SoloRunner.new(platform: 'freebsd', version: '10.3').converge('omnibus_updater::default') | ||
end | ||
|
||
it 'logs a warning that the platform is unsupported' do | ||
expect { chef_run }.to raise_error | ||
end | ||
end | ||
|
||
describe 'omnibus_updater::default with no attributes set' do | ||
cached(:chef_run) do | ||
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge('omnibus_updater::default') | ||
end | ||
|
||
it 'should complie without any errors' do | ||
it 'compiles without any errors' do | ||
expect { chef_run }.to_not raise_error | ||
end | ||
|
||
it 'includes the downloader recipe' do | ||
expect(chef_run).to include_recipe('omnibus_updater::downloader') | ||
end | ||
|
||
it 'includes the installer recipe' do | ||
expect(chef_run).to include_recipe('omnibus_updater::installer') | ||
end | ||
|
||
it 'includes the old_package_cleaner recipe' do | ||
expect(chef_run).to include_recipe('omnibus_updater::old_package_cleaner') | ||
end | ||
|
||
it 'does not include the remove_chef_system_gem recipe' do | ||
expect(chef_run).to_not include_recipe('omnibus_updater::remove_chef_system_gem') | ||
end | ||
end | ||
|
||
describe 'omnibus_updater::default with remove_chef_system_gem set' do | ||
let(:chef_run) do | ||
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04') do |node| | ||
node.normal['omnibus_updater']['remove_chef_system_gem'] = true | ||
end.converge('omnibus_updater::default') | ||
|
||
it 'includes the remove_chef_system_gem recipe' do | ||
expect(chef_run).to include_recipe('omnibus_updater::remove_chef_system_gem') | ||
end | ||
end | ||
end |