puppet-oslo/spec/defines/oslo_messaging_default_spec.rb
Alex Schultz 93e94704da Switch oslo to use rspec-puppet-facts
This change updates puppet-oslo to use rspec-puppet-facts for all rspec
tests.

Change-Id: I88771a90ff534c6055f2c852ab7e6474bf68c7bd
2016-04-11 08:39:17 -06:00

47 lines
1.4 KiB
Ruby

require 'spec_helper'
describe 'oslo::messaging::default' do
let (:title) { 'keystone_config' }
shared_examples 'oslo-messaging-default' do
context 'with default parameters' do
it 'configure DEFAULT default params' do
is_expected.to contain_keystone_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
end
end
context 'with overridden parameters' do
let :params do
{
:rpc_response_timeout => '42',
:transport_url => 'proto://url',
:control_exchange => 'openstack',
}
end
it 'configure DEFAULT with overriden values' do
is_expected.to contain_keystone_config('DEFAULT/rpc_response_timeout').with_value('42')
is_expected.to contain_keystone_config('DEFAULT/transport_url').with_value('proto://url')
is_expected.to contain_keystone_config('DEFAULT/control_exchange').with_value('openstack')
end
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'oslo-messaging-default'
end
end
end