
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
52 lines
1.7 KiB
Ruby
52 lines
1.7 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'keystone::endpoint' do
|
|
|
|
it { is_expected.to contain_keystone_service('keystone').with(
|
|
:ensure => 'present',
|
|
:type => 'identity',
|
|
:description => 'OpenStack Identity Service'
|
|
)}
|
|
|
|
describe 'with default parameters' do
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/keystone').with(
|
|
:ensure => 'present',
|
|
:public_url => 'http://127.0.0.1:5000/v2.0',
|
|
:admin_url => 'http://127.0.0.1:35357/v2.0',
|
|
:internal_url => 'http://127.0.0.1:5000/v2.0'
|
|
)}
|
|
end
|
|
|
|
describe 'with overridden parameters' do
|
|
|
|
let :params do
|
|
{ :version => 'v42.6',
|
|
:public_url => 'https://identity.some.tld/the/main/endpoint',
|
|
:admin_url => 'https://identity-int.some.tld/some/admin/endpoint',
|
|
:internal_url => 'https://identity-int.some.tld/some/internal/endpoint' }
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/keystone').with(
|
|
:ensure => 'present',
|
|
:public_url => 'https://identity.some.tld/the/main/endpoint/v42.6',
|
|
:admin_url => 'https://identity-int.some.tld/some/admin/endpoint/v42.6',
|
|
:internal_url => 'https://identity-int.some.tld/some/internal/endpoint/v42.6'
|
|
)}
|
|
end
|
|
|
|
describe 'without internal_url parameter' do
|
|
|
|
let :params do
|
|
{ :public_url => 'https://identity.some.tld/the/main/endpoint' }
|
|
end
|
|
|
|
it 'internal_url should default to public_url' do
|
|
is_expected.to contain_keystone_endpoint('RegionOne/keystone').with(
|
|
:ensure => 'present',
|
|
:public_url => 'https://identity.some.tld/the/main/endpoint/v2.0',
|
|
:internal_url => 'https://identity.some.tld/the/main/endpoint/v2.0'
|
|
)
|
|
end
|
|
end
|
|
end
|