| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'cloudkitty::config' do |
| 4 |
|
| 5 |
let(:config_hash) do { |
| 6 |
'DEFAULT/foo' => { 'value' => 'fooValue' }, |
| 7 |
'DEFAULT/bar' => { 'value' => 'barValue' }, |
| 8 |
'DEFAULT/baz' => { 'ensure' => 'absent' } |
| 9 |
} |
| 10 |
end |
| 11 |
|
| 12 |
shared_examples_for 'cloudkitty_config' do |
| 13 |
let :params do |
| 14 |
{ :cloudkitty_config => config_hash } |
| 15 |
end |
| 16 |
|
| 17 |
it { is_expected.to contain_class('cloudkitty::deps') } |
| 18 |
|
| 19 |
it 'configures arbitrary cloudkitty-config configurations' do |
| 20 |
is_expected.to contain_cloudkitty_config('DEFAULT/foo').with_value('fooValue') |
| 21 |
is_expected.to contain_cloudkitty_config('DEFAULT/bar').with_value('barValue') |
| 22 |
is_expected.to contain_cloudkitty_config('DEFAULT/baz').with_ensure('absent') |
| 23 |
end |
| 24 |
end |
| 25 |
|
| 26 |
shared_examples_for 'cloudkitty_api_paste_ini' do |
| 27 |
let :params do |
| 28 |
{ :cloudkitty_api_paste_ini => config_hash } |
| 29 |
end |
| 30 |
|
| 31 |
it 'configures arbitrary cloudkitty-api-paste-ini configurations' do |
| 32 |
is_expected.to contain_cloudkitty_api_paste_ini('DEFAULT/foo').with_value('fooValue') |
| 33 |
is_expected.to contain_cloudkitty_api_paste_ini('DEFAULT/bar').with_value('barValue') |
| 34 |
is_expected.to contain_cloudkitty_api_paste_ini('DEFAULT/baz').with_ensure('absent') |
| 35 |
end |
| 36 |
end |
| 37 |
|
| 38 |
on_supported_os({ |
| 39 |
:supported_os => OSDefaults.get_supported_os |
| 40 |
}).each do |os,facts| |
| 41 |
context "on #{os}" do |
| 42 |
let (:facts) do |
| 43 |
facts.merge!(OSDefaults.get_facts()) |
| 44 |
end |
| 45 |
|
| 46 |
it_configures 'cloudkitty_config' |
| 47 |
it_configures 'cloudkitty_api_paste_ini' |
| 48 |
end |
| 49 |
end |
| 50 |
end |