This repository has been archived by the owner on Feb 13, 2020. It is now read-only.
forked from voxpupuli/puppet-r10k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostrun_command_spec.rb
108 lines (98 loc) · 2.9 KB
/
postrun_command_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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
require 'spec_helper'
describe 'r10k::postrun_command', type: :class do
on_supported_os.each do |os, facts|
context "on #{os} " do
let :facts do
facts
end
context 'with Puppet Enterprise' do
let :facts do
facts.merge(
is_pe: true
)
end
context 'adding custom postrun_command' do
let :params do
{
command: 'r10k synchronize',
ensure: 'present'
}
end
it { is_expected.to contain_class('r10k::params') }
it do
is_expected.to contain_ini_setting('r10k_postrun_command').with(
ensure: 'present',
section: 'agent',
setting: 'postrun_command',
value: 'r10k synchronize'
)
end
end
context 'removing custom postrun_command' do
let :params do
{
command: 'r10k synchronize',
ensure: 'absent'
}
end
it { is_expected.to contain_class('r10k::params') }
it do
is_expected.to contain_ini_setting('r10k_postrun_command').with(
ensure: 'absent',
section: 'agent',
setting: 'postrun_command',
value: 'r10k synchronize'
)
end
end
end
context 'with Puppet FOSS' do
context 'adding default postrun_command' do
it { is_expected.to contain_class('r10k::params') }
it do
is_expected.to contain_ini_setting('r10k_postrun_command').with(
ensure: 'present',
section: 'agent',
setting: 'postrun_command',
value: 'r10k deploy environment -p'
)
end
end
context 'adding custom postrun_command' do
let :params do
{
command: 'r10k21 synchronize',
ensure: 'present'
}
end
it { is_expected.to contain_class('r10k::params') }
it do
is_expected.to contain_ini_setting('r10k_postrun_command').with(
ensure: 'present',
section: 'agent',
setting: 'postrun_command',
value: 'r10k21 synchronize'
)
end
end
context 'removing custom postrun_command' do
let :params do
{
command: 'r10k21 synchronize',
ensure: 'absent'
}
end
it { is_expected.to contain_class('r10k::params') }
it do
is_expected.to contain_ini_setting('r10k_postrun_command').with(
ensure: 'absent',
section: 'agent',
setting: 'postrun_command',
value: 'r10k21 synchronize'
)
end
end
end
end
end
end