@@ -102,13 +102,14 @@ def self.catalog_contains_resource(result, type, title)
102
102
expect ( @result . exception ) . to be_a_kind_of ( OctocatalogDiff ::Errors ::ReferenceValidationError )
103
103
end
104
104
105
+ # Multiple line numbers given because Puppet 4.x and 3.8 correspond to first and last line of resource, respectively.
105
106
# rubocop:disable Metrics/LineLength
106
107
it 'should have formatted error messages' do
107
108
msg = @result . exception . message
108
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 1\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:2 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
109
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:7 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
110
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:7 \) -> subscribe\[ Exec\[ subscribe target 2\] \] } )
111
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 3\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:15 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
109
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 1\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:(2|5) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
110
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:(7|13) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
111
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:(7|13) \) -> subscribe\[ Exec\[ subscribe target 2\] \] } )
112
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 3\] \( /environments/production/modules/test/manifests/subscribe_callers.pp:(15|21) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
112
113
expect ( msg ) . not_to match ( /exec\[ subscribe caller 3\] .+subscribe\[ Exec\[ subscribe caller 1\] \] / )
113
114
end
114
115
# rubocop:enable Metrics/LineLength
@@ -130,7 +131,7 @@ def self.catalog_contains_resource(result, type, title)
130
131
# rubocop:disable Metrics/LineLength
131
132
it 'should have formatted error messages' do
132
133
msg = @result . exception . message
133
- expect ( msg ) . to eq ( ' Catalog has broken reference: exec[before caller] (/environments/production/modules/test/manifests/before_callers.pp:2) -> before[Exec[before target]]' )
134
+ expect ( msg ) . to match ( %r{ Catalog has broken reference: exec\ [ before caller\] \ ( /environments/production/modules/test/manifests/before_callers.pp:(2|5) \) -> before\ [ Exec\ [ before target\] \] } )
134
135
end
135
136
# rubocop:enable Metrics/LineLength
136
137
end
@@ -151,7 +152,7 @@ def self.catalog_contains_resource(result, type, title)
151
152
# rubocop:disable Metrics/LineLength
152
153
it 'should have formatted error messages' do
153
154
msg = @result . exception . message
154
- expect ( msg ) . to match ( %r{exec\[ notify caller\] \( /environments/production/modules/test/manifests/notify_callers.pp:2 \) -> notify\[ Test::Foo::Bar\[ notify target\] \] } )
155
+ expect ( msg ) . to match ( %r{exec\[ notify caller\] \( /environments/production/modules/test/manifests/notify_callers.pp:(2|4) \) -> notify\[ Test::Foo::Bar\[ notify target\] \] } )
155
156
end
156
157
# rubocop:enable Metrics/LineLength
157
158
end
@@ -172,9 +173,9 @@ def self.catalog_contains_resource(result, type, title)
172
173
# rubocop:disable Metrics/LineLength
173
174
it 'should have formatted error messages' do
174
175
msg = @result . exception . message
175
- expect ( msg ) . to match ( %r{exec\[ require caller\] \( /environments/production/modules/test/manifests/require_callers.pp:2 \) -> require\[ Exec\[ require target\] \] } )
176
- expect ( msg ) . to match ( %r{exec\[ require caller 3\] \( /environments/production/modules/test/manifests/require_callers.pp:12 \) -> require\[ Exec\[ require target\] \] } )
177
- expect ( msg ) . to match ( %r{exec\[ require caller 4\] \( /environments/production/modules/test/manifests/require_callers.pp:12 \) -> require\[ Exec\[ require target\] \] } )
176
+ expect ( msg ) . to match ( %r{exec\[ require caller\] \( /environments/production/modules/test/manifests/require_callers.pp:(2|5) \) -> require\[ Exec\[ require target\] \] } )
177
+ expect ( msg ) . to match ( %r{exec\[ require caller 3\] \( /environments/production/modules/test/manifests/require_callers.pp:(12|18) \) -> require\[ Exec\[ require target\] \] } )
178
+ expect ( msg ) . to match ( %r{exec\[ require caller 4\] \( /environments/production/modules/test/manifests/require_callers.pp:(12|18) \) -> require\[ Exec\[ require target\] \] } )
178
179
expect ( msg ) . not_to match ( /exec\[ require caller 2\] / )
179
180
expect ( msg ) . not_to match ( /-> require\[ Exec\[ require caller\] \] / )
180
181
end
@@ -234,10 +235,10 @@ def self.catalog_contains_resource(result, type, title)
234
235
# rubocop:disable Metrics/LineLength
235
236
it 'should have formatted error messages' do
236
237
msg = @result . exception . message
237
- expect ( msg ) . to match ( %r{exec\[ before alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:2 \) -> before\[ Exec\[ before alias target\] \] } )
238
- expect ( msg ) . to match ( %r{exec\[ notify alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:7 \) -> before\[ Exec\[ notify alias target\] \] } )
239
- expect ( msg ) . to match ( %r{exec\[ require alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:12 \) -> before\[ Exec\[ require alias target\] \] } )
240
- expect ( msg ) . to match ( %r{exec\[ subscribe alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:17 \) -> before\[ Exec\[ subscribe alias target\] \] } )
238
+ expect ( msg ) . to match ( %r{exec\[ before alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:(2|5) \) -> before\[ Exec\[ before alias target\] \] } )
239
+ expect ( msg ) . to match ( %r{exec\[ notify alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:(7|10) \) -> before\[ Exec\[ notify alias target\] \] } )
240
+ expect ( msg ) . to match ( %r{exec\[ require alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:(12|15) \) -> before\[ Exec\[ require alias target\] \] } )
241
+ expect ( msg ) . to match ( %r{exec\[ subscribe alias caller\] \( /environments/production/modules/test/manifests/alias_callers.pp:(17|20) \) -> before\[ Exec\[ subscribe alias target\] \] } )
241
242
end
242
243
# rubocop:enable Metrics/LineLength
243
244
end
@@ -290,10 +291,10 @@ def self.catalog_contains_resource(result, type, title)
290
291
# rubocop:disable Metrics/LineLength
291
292
it 'should have formatted error messages' do
292
293
msg = @result . exception . message
293
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 1\] \( .+/modules/test/manifests/subscribe_callers.pp:2 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
294
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:7 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
295
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:7 \) -> subscribe\[ Exec\[ subscribe target 2\] \] } )
296
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 3\] \( .+/modules/test/manifests/subscribe_callers.pp:15 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
294
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 1\] \( .+/modules/test/manifests/subscribe_callers.pp:(2|5) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
295
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:(7|13) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
296
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:(7|13) \) -> subscribe\[ Exec\[ subscribe target 2\] \] } )
297
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 3\] \( .+/modules/test/manifests/subscribe_callers.pp:(15|21) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
297
298
end
298
299
# rubocop:enable Metrics/LineLength
299
300
end
@@ -336,10 +337,10 @@ def self.catalog_contains_resource(result, type, title)
336
337
# rubocop:disable Metrics/LineLength
337
338
it 'should have formatted error messages from to-catalog only' do
338
339
msg = @result . exception . message
339
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 1\] \( .+/modules/test/manifests/subscribe_callers.pp:2 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
340
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:7 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
341
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:7 \) -> subscribe\[ Exec\[ subscribe target 2\] \] } )
342
- expect ( msg ) . to match ( %r{exec\[ subscribe caller 3\] \( .+/modules/test/manifests/subscribe_callers.pp:15 \) -> subscribe\[ Exec\[ subscribe target\] \] } )
340
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 1\] \( .+/modules/test/manifests/subscribe_callers.pp:(2|5) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
341
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:(7|13) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
342
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 2\] \( .+/modules/test/manifests/subscribe_callers.pp:(7|13) \) -> subscribe\[ Exec\[ subscribe target 2\] \] } )
343
+ expect ( msg ) . to match ( %r{exec\[ subscribe caller 3\] \( .+/modules/test/manifests/subscribe_callers.pp:(15|21) \) -> subscribe\[ Exec\[ subscribe target\] \] } )
343
344
expect ( msg ) . not_to match ( /require target/ )
344
345
end
345
346
# rubocop:enable Metrics/LineLength
0 commit comments