Skip to content

Instantly share code, notes, and snippets.

@ericr3r
Created September 20, 2013 04:23
Show Gist options
  • Save ericr3r/6633275 to your computer and use it in GitHub Desktop.
Save ericr3r/6633275 to your computer and use it in GitHub Desktop.
Chef Infrastructure errata
require 'chefspec'
describe 'my_cookbook::default' do
let(:chef_run) { ChefSpec::ChefRunner.new(platform:'ubuntu', version:'12.04') }
it 'creates a greetings file, containing the platform name' do
chef_run.converge(described_recipe)
expect(chef_run).to create_file_with_content('/tmp/greeting.txt','Hello! ubuntu!')
end
it 'uses a node attribute as greeting text' do
chef_run.node.override['my_cookbook']['greeting'] = "Go!"
chef_run.converge(described_recipe)
expect(chef_run).to create_file_with_content('/tmp/greeting.txt','Go! ubuntu!')
end
end
@mmarschall
Copy link

Thanks a lot for finding this and sorry for any inconvenience it may have caused you.
The errata should go online on packtpub.com soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment