Merge "Convert spec testing to rspec-puppet-facts"
This commit is contained in:
commit
96a44a367d
|
@ -1,9 +1,9 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'ec2api::config' do
|
describe 'ec2api::config' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :ec2api_config => {
|
{
|
||||||
|
:ec2api_config => {
|
||||||
'DEFAULT/foo' => { 'value' => 'fooValue' },
|
'DEFAULT/foo' => { 'value' => 'fooValue' },
|
||||||
'DEFAULT/bar' => { 'value' => 'barValue' },
|
'DEFAULT/bar' => { 'value' => 'barValue' },
|
||||||
'DEFAULT/baz' => { 'ensure' => 'absent' }
|
'DEFAULT/baz' => { 'ensure' => 'absent' }
|
||||||
|
@ -16,18 +16,31 @@ describe 'ec2api::config' do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_class('ec2api::deps') }
|
shared_examples 'ec2api::config' do
|
||||||
|
it { should contain_class('ec2api::deps') }
|
||||||
|
|
||||||
it 'configures arbitrary ec2api configurations' do
|
it {
|
||||||
is_expected.to contain_ec2api_config('DEFAULT/foo').with_value('fooValue')
|
should contain_ec2api_config('DEFAULT/foo').with_value('fooValue')
|
||||||
is_expected.to contain_ec2api_config('DEFAULT/bar').with_value('barValue')
|
should contain_ec2api_config('DEFAULT/bar').with_value('barValue')
|
||||||
is_expected.to contain_ec2api_config('DEFAULT/baz').with_ensure('absent')
|
should contain_ec2api_config('DEFAULT/baz').with_ensure('absent')
|
||||||
|
}
|
||||||
|
|
||||||
|
it {
|
||||||
|
should contain_ec2api_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
|
||||||
|
should contain_ec2api_api_paste_ini('DEFAULT/bar2').with_value('barValue')
|
||||||
|
should contain_ec2api_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures arbitrary ec2api-api-paste configurations' do
|
on_supported_os({
|
||||||
is_expected.to contain_ec2api_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
|
:supported_os => OSDefaults.get_supported_os
|
||||||
is_expected.to contain_ec2api_api_paste_ini('DEFAULT/bar2').with_value('barValue')
|
}).each do |os,facts|
|
||||||
is_expected.to contain_ec2api_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
|
context "on #{os}" do
|
||||||
end
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'ec2api::config'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue