From 6ca83d7f134bf6a59013592fbdf26f7448438847 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Thu, 15 Dec 2016 10:51:36 -0800 Subject: [PATCH] Add ubuntu 16.04 as default platform 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 ``` --- spec/default_spec.rb | 14 +++++++------- spec/vmware_spec.rb | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/default_spec.rb b/spec/default_spec.rb index ff6e81a..3f879ec 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -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 @@ -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 @@ -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 diff --git a/spec/vmware_spec.rb b/spec/vmware_spec.rb index 331ae47..54b1ef4 100644 --- a/spec/vmware_spec.rb +++ b/spec/vmware_spec.rb @@ -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