
This patch aim to update our specs test in order to work with the rspec-puppet release 2.0.0, in the mean time, we update rspec syntax in order to be prepared for rspec 3.x move. In details: * Use shared_examples "a Puppet::Error" for puppet::error tests * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) * Fix spec tests for rspec-puppet 2.0.0 * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper) * Standardize gemfile (add json, webmock) Change-Id: I35a39d4f3919d56c9448f0a0602cfe284ebc2e9c Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
42 lines
841 B
Ruby
42 lines
841 B
Ruby
require 'spec_helper'
|
|
|
|
describe 'keystone::policy' do
|
|
|
|
shared_examples_for 'keystone policies' do
|
|
let :params do
|
|
{
|
|
:policy_path => '/etc/keystone/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
|
|
|
|
context 'on Debian platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'Debian' }
|
|
end
|
|
|
|
it_configures 'keystone policies'
|
|
end
|
|
|
|
context 'on RedHat platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
|
|
it_configures 'keystone policies'
|
|
end
|
|
end
|