I'm learning to write integration tests for my Chef cookbooks. Is it possible to reference variables from the attributes
folder within my test?
Here's my test to make sure httpd
and php
are installed properly. However, I have additional packages I want to check for.
test/smoke/default/install.rb
%w(httpd php).each do |rpm_package|
describe package(rpm_package) do
it { should be_installed }
end
end
attributes/default.rb
default['ic_apachephp']['php_packages'] = [
'php-mysqlnd',
'php-mbstring',
'php-gd',
'php-xml',
'php'
]