module-puppetlabs-mysql/spec/acceptance/mysql_server_config_spec.rb
Ashley Penney 90c5abc4bb Add tests for all missing parameters.
This commit adds tests for the parameters that were previously untested.
Most of this testing is light, but all parameters of the module are now
called at least once.  Generally we're testing the happy path, so these
need further work in future.
2013-12-10 16:56:20 -05:00

45 lines
989 B
Ruby

require 'spec_helper_acceptance'
describe 'config location' do
it 'creates the file elsewhere' do
pp = <<-EOS
class { 'mysql::server':
config_file => '/etc/testmy.cnf',
}
EOS
apply_manifest(pp, :catch_failures => true)
end
describe file('/etc/testmy.cnf') do
it { should be_file }
end
end
describe 'manage_config_file' do
it 'wont reset the location of my.cnf' do
pp = <<-EOS
class { 'mysql::server':
config_file => '/etc/my.cnf',
manage_config_file => false,
}
EOS
# Make sure this doesn't exist so we can test if puppet
# readded it
shell('rm /etc/my.cnf')
apply_manifest(pp, :catch_failures => true)
end
describe file('/etc/my.cnf') do
it { should_not be_file }
end
end
describe 'resets' do
it 'cleans up' do
pp = <<-EOS
class { 'mysql::server': }
EOS
apply_manifest(pp, :catch_failures => true)
shell('rm /etc/testmy.cnf')
end
end