Skip to content

Commit

Permalink
Add ubuntu 16.04 as default platform
Browse files Browse the repository at this point in the history
Cleans up chefspec deprecation warnings for not setting a platform
```
WARNING: you must specify a platform and platform_version to your ChefSpec Runner and/or Fauxhai constructor, in the future omitting these will become a hard error
```
  • Loading branch information
shortdudey123 committed Dec 15, 2016
1 parent e6b1f90 commit 6ca83d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe 'hostname::default' do
context 'wtih set_fqdn as full FQDN' do
let(:chef_run) do
ChefSpec::SoloRunner.new do |node|
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04') do |node|
node.normal['set_fqdn'] = 'test.example.com'
end.converge described_recipe
end
Expand Down Expand Up @@ -42,17 +42,17 @@

context 'wtih set_fqdn as wildcard FQDN' do
let(:chef_run) do
ChefSpec::SoloRunner.new do |node|
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04') do |node|
node.normal['set_fqdn'] = '*.example.com'
end.converge described_recipe
end

it 'update /etc/hostname' do
expect(chef_run).to render_file('/etc/hostname').with_content("chefspec\n")
expect(chef_run).to render_file('/etc/hostname').with_content("fauxhai\n")
end

it 'execute hostname chefspec' do
expect(chef_run).to_not run_execute('hostname chefspec')
it 'execute hostname fauxhai' do
expect(chef_run).to run_execute('hostname fauxhai')
end

it 'append hostsfile_entry with localhost' do
Expand All @@ -65,8 +65,8 @@
it 'create hostsfile_entry with hostname' do
expect(chef_run).to create_hostsfile_entry('set hostname').with(
ip_address: '127.0.1.1',
hostname: 'chefspec.local.example.com', # node.name in chefspec returns chefspec.local
aliases: %w(chefspec),
hostname: 'fauxhai.local.example.com', # node.name in chefspec returns chefspec.local
aliases: %w(fauxhai),
unique: true
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/vmware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
require 'spec_helper'

describe 'hostname::vmware' do
let(:chef_run) { ChefSpec::SoloRunner.new.converge described_recipe }
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge described_recipe }
end

0 comments on commit 6ca83d7

Please sign in to comment.