Skip to content

Instantly share code, notes, and snippets.

@joelhandwell
Created January 27, 2016 22:10
Show Gist options
  • Save joelhandwell/d711b7c0c10383823048 to your computer and use it in GitHub Desktop.
Save joelhandwell/d711b7c0c10383823048 to your computer and use it in GitHub Desktop.
github.com/haapp/w_apache chef composer recipe plan
# metadata.rb line 24
depends 'composer'
# Berksfile line 20
cookbook 'composer'
# recipes/default.rb line 71
include_recipe 'w_apache::composer' if node['w_apache']['composer_enabled']
# recipes/composer.rb line 1
include_recipe 'composer'
# spec/composer_spec.rb
# ...
node.set['w_apache']['composer_enabled'] = true
# ...
it '... ' do
expect(chef_run).to include_recipe('composer')
end
it '... ' do
expect(chef_run).to render_file('/usr/local/bin/composer')
end
# https://github.com/haapp/serverspec-environments/blob/master/testkitchen.json#L75
# add this ->"composer_enabled": true,
# https://github.com/haapp/serverspec-w_apache
# serverspec/localhost/composer_spec.rb
describe file('/usr/local/bin/composer') do
it { should be_file }
end
describe command('composer') do
its(:stdout) { should match /Composer version/ }
its(:exit_status) { should eq 0 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment