puppet-nova/spec/classes/nova_db_mysql_spec.rb
Mathieu Gagné c566d711e8 Add charset param to nova::db::mysql
Allow to specify the database charset but still default to 'latin1' if
none is provided.

Remove nova::params::nova_db_charset. Both osfamily were using 'latin1'
since the update for Folsom in 76d4632.
2013-03-20 18:16:14 -04:00

62 lines
1.4 KiB
Ruby

require 'spec_helper'
describe 'nova::db::mysql' do
let :required_params do
{ :password => "qwerty" }
end
context 'on a Debian osfamily' do
let :facts do
{ :osfamily => "Debian" }
end
context 'with only required parameters' do
let :params do
required_params
end
it { should contain_mysql__db('nova').with(
:user => 'nova',
:password => 'qwerty',
:charset => 'latin1',
:require => "Class[Mysql::Config]"
)}
end
context 'when overriding charset' do
let :params do
{ :charset => 'utf8' }.merge(required_params)
end
it { should contain_mysql__db('nova').with_charset(params[:charset]) }
end
end
context 'on a RedHat osfamily' do
let :facts do
{ :osfamily => 'RedHat' }
end
context 'with only required parameters' do
let :params do
required_params
end
it { should contain_mysql__db('nova').with(
:user => 'nova',
:password => 'qwerty',
:charset => 'latin1',
:require => "Class[Mysql::Config]"
)}
end
context 'when overriding charset' do
let :params do
{ :charset => 'utf8' }.merge(required_params)
end
it { should contain_mysql__db('nova').with_charset(params[:charset]) }
end
end
end