@@ -236,24 +236,36 @@ def vrrp_instance_file_name(name)
236
236
end
237
237
238
238
it ( 'should render a config file with the notify_stop correctly' ) do
239
- is_expected . to render_file ( file_name ) . with_content ( %r{notify_stop\s /path/to_stop\. sh} )
239
+ is_expected . to render_file ( file_name ) . with_content { |s |
240
+ expect ( s . scan ( %r{notify_stop\s /path/to_stop\. sh} ) . size ) . to eq ( 1 )
241
+ }
242
+
240
243
end
241
244
242
245
it ( 'should render a config file with the notify_master correctly' ) do
243
- is_expected . to render_file ( file_name ) . with_content ( %r{notify_master\s /path/to_master\. sh} )
246
+ is_expected . to render_file ( file_name ) . with_content { |s |
247
+ expect ( s . scan ( %r{notify_master\s /path/to_master\. sh} ) . size ) . to eq ( 1 )
248
+ }
244
249
end
245
250
246
251
it ( 'should render a config file with the notify_backup correctly' ) do
247
- is_expected . to render_file ( file_name ) . with_content ( %r{notify_backup\s /path/to_backup\. sh} )
252
+ is_expected . to render_file ( file_name ) . with_content { |s |
253
+ expect ( s . scan ( %r{notify_backup\s /path/to_backup\. sh} ) . size ) . to eq ( 1 )
254
+ }
248
255
end
249
256
250
257
it ( 'should render a config file with the notify_fault correctly' ) do
251
- is_expected . to render_file ( file_name ) . with_content ( %r{notify_fault\s /path/fault\. sh} )
258
+ is_expected . to render_file ( file_name ) . with_content { |s |
259
+ expect ( s . scan ( %r{notify_fault\s /path/fault\. sh} ) . size ) . to eq ( 1 )
260
+ }
252
261
end
253
262
254
263
it ( 'should render a config file with the notify correctly' ) do
255
- is_expected . to render_file ( file_name ) . with_content ( %r{notify\s /path/notify\. sh} )
264
+ is_expected . to render_file ( file_name ) . with_content { |s |
265
+ expect ( s . scan ( %r{notify\s /path/notify\. sh} ) . size ) . to eq ( 1 )
266
+ }
256
267
end
268
+
257
269
it ( 'should render a config file with the smtp_alert set to true' ) do
258
270
is_expected . to render_file ( file_name ) . with_content ( /smtp_alert\s true/ )
259
271
end
0 commit comments