module-puppetlabs-mysql/spec/defines/mysql_server_config_spec.rb
Simon Effenberg e47b4d19e7 fixed documentation and added rspec
* fixed a typo in the documentation
* added documentation for parameter +notify_service+
* added rspec test
2012-08-24 08:01:33 +02:00

37 lines
935 B
Ruby

require 'spec_helper'
describe 'mysql::server::config', :type => :define do
filename = '/etc/mysql/conf.d/test_config.cnf'
let :facts do
{ :osfamily => 'Debian'}
end
let(:title) { File.basename(filename, '.cnf') }
let(:params) {
{ 'settings' => {
'mysqld' => {
'bind-address' => '0.0.0.0'
}
}
}
}
it 'should notify the mysql daemon' do
should contain_file(filename).with_notify('Exec[mysqld-restart]')
end
it 'should contain config parameter in content' do
should contain_file(filename).with_content("### MANAGED BY PUPPET ###\n[mysqld]\nbind-address = 0.0.0.0\n\n")
end
it 'should not notify the mysql daemon' do
params.merge!({ 'notify_service' => false })
should contain_file(filename).without_notify
end
it 'should require on the mysql-server package' do
should contain_file(filename).with_require('Package[mysql-server]')
end
end