forked from theforeman/puppet-foreman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforeman_repo_spec.rb
52 lines (44 loc) · 1.49 KB
/
foreman_repo_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require 'spec_helper'
describe 'foreman::repo' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
describe 'with default parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_anchor('foreman::repo') }
it { is_expected.not_to contain_foreman__repos('foreman') }
end
describe 'with minimal parameters' do
let(:params) { {repo: 'nightly'} }
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_foreman__repos('foreman')
.with_repo('nightly')
.with_gpgcheck(true)
.with_yum_repo_baseurl('https://yum.theforeman.org')
}
it do
if facts[:osfamily] == 'RedHat' && facts[:os]['release']['major'] == '8'
is_expected.to contain_package('foreman').with_ensure('el8').with_provider('dnfmodule')
else
is_expected.not_to contain_package('foreman')
end
end
end
describe 'with explicit parameters' do
let :params do
{
repo: '1.19',
yum_repo_baseurl: 'https://example.org'
}
end
it { is_expected.to compile.with_all_deps }
it 'should include OS repos' do
is_expected.to contain_foreman__repos('foreman')
.with_repo('1.19')
.with_gpgcheck(true)
.with_yum_repo_baseurl('https://example.org')
end
end
end
end
end