Skip to content

Commit

Permalink
Merge pull request #61 from shortdudey123/fix_tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
mburns authored Dec 16, 2016
2 parents be88b06 + 6ca83d7 commit 4620235
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ gem 'rake'
gem 'rubocop'

group :integration do
gem 'test-kitchen'
gem 'kitchen-vagrant'
gem 'test-kitchen'
end
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 4620235

Please sign in to comment.