|
13 | 13 | :owner => nil, |
14 | 14 | :group => nil, |
15 | 15 | :mode => '0644', |
16 | | - :warn_header => false, |
17 | | - #:force => false, |
| 16 | + :warn => false, |
18 | 17 | :backup => 'puppet', |
19 | 18 | :replace => true, |
20 | 19 | }.merge(params) |
|
168 | 167 | end |
169 | 168 | end # mode => |
170 | 169 |
|
171 | | - context 'warn_header =>' do |
| 170 | + context 'warn =>' do |
172 | 171 | [true, false, '# foo'].each do |warn| |
173 | 172 | context warn do |
174 | | - it_behaves_like 'concat', '/etc/foo.bar', { :warn_header => warn } |
| 173 | + it_behaves_like 'concat', '/etc/foo.bar', { :warn => warn } |
175 | 174 | end |
176 | 175 | end |
177 | 176 |
|
178 | 177 | context '(stringified boolean)' do |
179 | 178 | ['true', 'yes', 'on', 'false', 'no', 'off'].each do |warn| |
180 | 179 | context warn do |
181 | | - it_behaves_like 'concat', '/etc/foo.bar', { :warn_header => warn } |
| 180 | + it_behaves_like 'concat', '/etc/foo.bar', { :warn => warn } |
182 | 181 |
|
183 | 182 | it 'should create a warning' do |
184 | 183 | skip('rspec-puppet support for testing warning()') |
|
189 | 188 |
|
190 | 189 | context '123' do |
191 | 190 | let(:title) { '/etc/foo.bar' } |
192 | | - let(:params) {{ :warn_header => 123 }} |
| 191 | + let(:params) {{ :warn => 123 }} |
193 | 192 | it 'should fail' do |
194 | 193 | expect { catalogue }.to raise_error(Puppet::Error, /is not a string or boolean/) |
195 | 194 | end |
196 | 195 | end |
197 | 196 | end # warn => |
198 | 197 |
|
199 | | - #context 'force =>' do |
200 | | - # [true, false].each do |force| |
201 | | - # context force do |
202 | | - # it_behaves_like 'concat', '/etc/foo.bar', { :force => force } |
203 | | - # end |
204 | | - # end |
205 | | - |
206 | | - # context '123' do |
207 | | - # let(:title) { '/etc/foo.bar' } |
208 | | - # let(:params) {{ :force => 123 }} |
209 | | - # it 'should fail' do |
210 | | - # expect { catalogue }.to raise_error(Puppet::Error, /is not a boolean/) |
211 | | - # end |
212 | | - # end |
213 | | - #end # force => |
214 | | - |
215 | 198 | context 'backup =>' do |
216 | 199 | context 'reverse' do |
217 | 200 | it_behaves_like 'concat', '/etc/foo.bar', { :backup => 'reverse' } |
|
250 | 233 | end |
251 | 234 | end # replace => |
252 | 235 |
|
253 | | - #context 'order =>' do |
254 | | - # ['alpha', 'numeric'].each do |order| |
255 | | - # context order do |
256 | | - # it_behaves_like 'concat', '/etc/foo.bar', { :order => order } |
257 | | - # end |
258 | | - # end |
259 | | - |
260 | | - # context 'invalid' do |
261 | | - # let(:title) { '/etc/foo.bar' } |
262 | | - # let(:params) {{ :order => 'invalid' }} |
263 | | - # it 'should fail' do |
264 | | - # expect { catalogue }.to raise_error(Puppet::Error, /#{Regexp.escape('does not match "^alpha$|^numeric$"')}/) |
265 | | - # end |
266 | | - # end |
267 | | - #end # order => |
| 236 | + context 'order =>' do |
| 237 | + ['alpha', 'numeric'].each do |order| |
| 238 | + context order do |
| 239 | + it_behaves_like 'concat', '/etc/foo.bar', { :order => order } |
| 240 | + end |
| 241 | + end |
| 242 | + |
| 243 | + context 'invalid' do |
| 244 | + let(:title) { '/etc/foo.bar' } |
| 245 | + let(:params) {{ :order => 'invalid' }} |
| 246 | + it 'should fail' do |
| 247 | + expect { catalogue }.to raise_error(Puppet::Error, /#{Regexp.escape('does not match "^alpha$|^numeric$"')}/) |
| 248 | + end |
| 249 | + end |
| 250 | + end # order => |
268 | 251 | end |
0 commit comments