puppet-zaqar/spec/classes/zaqar_policy_spec.rb
Alex Schultz 366deb93cb Switch zaqar to use rspec-puppet-facts
This change updates the tests to use rspec-puppet-facts. Additionally
this change fixes the relationship in zaqar::server_instance for Debian
based systems.

Change-Id: I03ce4ee17feec1f0ea7012ea116c9c12cf3bde5f
2016-02-18 21:35:02 -07:00

38 lines
805 B
Ruby

require 'spec_helper'
describe 'zaqar::policy' do
shared_examples_for 'zaqar policies' do
let :params do
{
:policy_path => '/etc/zaqar/policy.json',
:policies => {
'context_is_admin' => {
'key' => 'context_is_admin',
'value' => 'foo:bar'
}
}
}
end
it 'set up the policies' do
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
:key => 'context_is_admin',
:value => 'foo:bar'
})
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_configures 'zaqar policies'
end
end
end