puppet-nova/spec/classes/nova_db_mysql_spec.rb
Dan Bode c9757ec448 require sections are specified in nova_config
This massive code commit actually implements something very simple.

previously, we allowed nova_config to omit a section and assumed that
section was default.

This commit updates the code to require section names for all settings.

This change is being made b/c:
- it better maps to the config on disk
- it is consistent with the other modules

Change-Id: Iae71a4c48ed0f9792566f16f0bf13e61569b46e5
2013-04-12 15:06:58 -07: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