puppet-zaqar/spec/classes/zaqar_server_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

39 lines
880 B
Ruby

require 'spec_helper'
describe 'zaqar::server' do
shared_examples_for 'zaqar::server' do
describe 'with a zaqar server enabled' do
let :pre_condition do
"class {'::zaqar': admin_password => 'foo'}"
end
it { is_expected.to contain_service(platform_params[:zaqar_service_name]).with(
:ensure => 'running',
:enable => true
)}
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
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :zaqar_service_name => 'zaqar' }
when 'RedHat'
{ :zaqar_service_name => 'openstack-zaqar' }
end
end
it_configures 'zaqar::server'
end
end
end