|
17 | 17 | it 'sets expected defaults' do |
18 | 18 | expect(subject).to contain_class('kibana').with( |
19 | 19 | ensure: 'present', |
20 | | - manage_repo: true |
| 20 | + manage_repo: true, |
21 | 21 | ) |
22 | 22 | end |
23 | 23 |
|
24 | 24 | it 'declares install before config' do |
25 | | - expect(subject).to contain_class('kibana::install'). |
26 | | - that_comes_before('Class[kibana::config]') |
| 25 | + expect(subject).to contain_class('kibana::install') |
| 26 | + .that_comes_before('Class[kibana::config]') |
27 | 27 | end |
28 | 28 |
|
29 | 29 | it { is_expected.to contain_class('kibana::config') } |
30 | 30 |
|
31 | 31 | it 'subscribes service to config' do |
32 | | - expect(subject).to contain_class('kibana::service'). |
33 | | - that_subscribes_to('Class[kibana::config]') |
| 32 | + expect(subject).to contain_class('kibana::service') |
| 33 | + .that_subscribes_to('Class[kibana::config]') |
34 | 34 | end |
35 | 35 |
|
36 | 36 | it 'installs the kibana config file' do |
37 | | - expect(subject).to contain_file('/etc/kibana/kibana.yml'). |
38 | | - with( |
| 37 | + expect(subject).to contain_file('/etc/kibana/kibana.yml') |
| 38 | + .with( |
39 | 39 | ensure: 'file', |
40 | 40 | owner: 'kibana', |
41 | 41 | group: 'kibana', |
42 | | - mode: '0660' |
43 | | - ). |
44 | | - with_content(sensitive(%r{ |
| 42 | + mode: '0660', |
| 43 | + ) |
| 44 | + .with_content(sensitive(%r{ |
45 | 45 | # Managed by Puppet.. |
46 | 46 | ---. |
47 | 47 | }xm)) |
|
50 | 50 | it 'enables and starts the service' do |
51 | 51 | expect(subject).to contain_service('kibana').with( |
52 | 52 | ensure: true, |
53 | | - enable: true |
| 53 | + enable: true, |
54 | 54 | ) |
55 | 55 | end |
56 | 56 |
|
57 | 57 | it { is_expected.to contain_package('kibana').with_ensure('present') } |
58 | 58 |
|
59 | 59 | it do |
60 | | - expect(subject).to contain_class('elastic_stack::repo'). |
61 | | - that_comes_before('Class[kibana::install]') |
| 60 | + expect(subject).to contain_class('elastic_stack::repo') |
| 61 | + .that_comes_before('Class[kibana::install]') |
62 | 62 | end |
63 | 63 |
|
64 | 64 | case facts[:os]['family'] |
65 | 65 | when 'Debian' |
66 | 66 | describe "#{facts[:os]['family']} resources" do |
67 | 67 | it 'updates package cache before installing kibana' do |
68 | | - expect(subject).to contain_class('apt::update'). |
69 | | - that_comes_before('Package[kibana]') |
| 68 | + expect(subject).to contain_class('apt::update') |
| 69 | + .that_comes_before('Package[kibana]') |
70 | 70 | end |
71 | 71 | end |
72 | 72 | end |
|
76 | 76 | describe 'removal' do |
77 | 77 | let :params do |
78 | 78 | { |
79 | | - ensure: 'absent' |
| 79 | + ensure: 'absent', |
80 | 80 | } |
81 | 81 | end |
82 | 82 |
|
83 | 83 | it { is_expected.to compile.with_all_deps } |
84 | 84 |
|
85 | 85 | it 'sets expected defaults' do |
86 | 86 | expect(subject).to contain_class('kibana').with( |
87 | | - ensure: 'absent' |
| 87 | + ensure: 'absent', |
88 | 88 | ) |
89 | 89 | end |
90 | 90 |
|
91 | 91 | it 'manages service before config' do |
92 | | - expect(subject).to contain_class('kibana::service'). |
93 | | - that_comes_before('Class[kibana::config]') |
| 92 | + expect(subject).to contain_class('kibana::service') |
| 93 | + .that_comes_before('Class[kibana::config]') |
94 | 94 | end |
95 | 95 |
|
96 | 96 | it 'manages config before install' do |
97 | | - expect(subject).to contain_class('kibana::config'). |
98 | | - that_comes_before('Class[kibana::install]') |
| 97 | + expect(subject).to contain_class('kibana::config') |
| 98 | + .that_comes_before('Class[kibana::install]') |
99 | 99 | end |
100 | 100 |
|
101 | 101 | it { is_expected.to contain_class('kibana::install') } |
102 | 102 |
|
103 | 103 | it 'stops and disables the service' do |
104 | | - expect(subject).to contain_service('kibana'). |
105 | | - with( |
| 104 | + expect(subject).to contain_service('kibana') |
| 105 | + .with( |
106 | 106 | ensure: false, |
107 | | - enable: false |
| 107 | + enable: false, |
108 | 108 | ) |
109 | 109 | end |
110 | 110 |
|
111 | 111 | it 'removes the kibana config file' do |
112 | | - expect(subject).to contain_file('/etc/kibana/kibana.yml'). |
113 | | - with(ensure: 'absent') |
| 112 | + expect(subject).to contain_file('/etc/kibana/kibana.yml') |
| 113 | + .with(ensure: 'absent') |
114 | 114 | end |
115 | 115 |
|
116 | 116 | it { is_expected.to contain_package('kibana').with_ensure('absent') } |
|
126 | 126 | it { is_expected.to compile.with_all_deps } |
127 | 127 |
|
128 | 128 | it { |
129 | | - expect(subject).to contain_package('kibana'). |
130 | | - with_ensure(param) |
| 129 | + expect(subject).to contain_package('kibana') |
| 130 | + .with_ensure(param) |
131 | 131 | } |
132 | 132 | end |
133 | 133 | end |
|
147 | 147 | 'server.port' => 5601, |
148 | 148 | 'elasticsearch.ssl.verify' => true, |
149 | 149 | 'elasticsearch.requestHeadersWhitelist' => ['authorization'], |
150 | | - 'tilemap' => { 'url' => 'https://test' } |
| 150 | + 'tilemap' => { 'url' => 'https://test' }, |
151 | 151 | }.each do |key, val| |
152 | 152 | context "'#{val}'" do |
153 | 153 | let(:params) { { config: { key => val } } } |
|
161 | 161 | { |
162 | 162 | 'server.basePath' => 4.2, |
163 | 163 | 5601 => :undef, |
164 | | - '' => :undef |
| 164 | + '' => :undef, |
165 | 165 | }.each do |key, val| |
166 | 166 | context "'#{val}'" do |
167 | 167 | let(:params) { { config: { key => val } } } |
|
190 | 190 | it 'enables and starts the custom service' do |
191 | 191 | expect(subject).to contain_service('kibana-custom').with( |
192 | 192 | ensure: true, |
193 | | - enable: true |
| 193 | + enable: true, |
194 | 194 | ) |
195 | 195 | end |
196 | 196 | end |
|
217 | 217 | let(:params) { { package_source: package_source } } |
218 | 218 |
|
219 | 219 | it { |
220 | | - expect(subject).to contain_package('kibana'). |
221 | | - with_source(package_source) |
| 220 | + expect(subject).to contain_package('kibana') |
| 221 | + .with_source(package_source) |
222 | 222 | } |
223 | 223 |
|
224 | 224 | case facts[:os]['family'] |
225 | 225 | when 'Debian' |
226 | 226 | it { |
227 | | - expect(subject).to contain_package('kibana'). |
228 | | - with_provider('dpkg') |
| 227 | + expect(subject).to contain_package('kibana') |
| 228 | + .with_provider('dpkg') |
229 | 229 | } |
230 | 230 | when 'RedHat' |
231 | 231 | it { |
232 | | - expect(subject).to contain_package('kibana'). |
233 | | - with_provider('rpm') |
| 232 | + expect(subject).to contain_package('kibana') |
| 233 | + .with_provider('rpm') |
234 | 234 | } |
235 | 235 | else |
236 | 236 | it { is_expected.not_to compile.with_all_deps } |
|
242 | 242 | let(:params) { { package_name: 'kibana-custom' } } |
243 | 243 |
|
244 | 244 | it { |
245 | | - expect(subject).to contain_package('kibana'). |
246 | | - with_name('kibana-custom') |
| 245 | + expect(subject).to contain_package('kibana') |
| 246 | + .with_name('kibana-custom') |
247 | 247 | } |
248 | 248 | end |
249 | 249 |
|
|
0 commit comments