Add generated cookbook content
This commit is contained in:
3
spec/spec_helper.rb
Normal file
3
spec/spec_helper.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
require 'chefspec'
|
||||
require 'chefspec/berkshelf'
|
35
spec/unit/recipes/default_spec.rb
Normal file
35
spec/unit/recipes/default_spec.rb
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Cookbook:: t42-common
|
||||
# Spec:: default
|
||||
#
|
||||
# Copyright:: 2019, The Authors, All Rights Reserved.
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 't42-common::default' 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
|
||||
runner = ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'converges successfully' 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
|
Reference in New Issue
Block a user