Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Add CentOS Platform to unit tests generated by chef generate cookbook #1417

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 RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ cookbooks to supermarkets.
The cookbook generator now adds a LICENSE file when creating a new
cookbook.


## Boilerplate tests are generated for the CentOS platform
When `chef generate cookbook` is ran, boilerplate unit tests for the CentOS 7 platform are now generated as well.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require 'spec_helper'

describe '<%= cookbook_name %>::<%= recipe_name %>' do
context 'When all attributes are default, on an Ubuntu 16.04' do
context 'When all attributes are default, on Ubuntu 16.04' do
let(:chef_run) do
# for a complete list of available platforms and versions see:
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
Expand All @@ -19,4 +19,17 @@ describe '<%= cookbook_name %>::<%= recipe_name %>' do
expect { chef_run }.to_not raise_error
end
end

context 'When all attributes are default, on CentOS 7.4.1708' do
let(:chef_run) do
# for a complete list of available platforms and versions see:
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '7.4.1708')
runner.converge(described_recipe)
end

it 'converges successfully' do
expect { chef_run }.to_not raise_error
end
end
end