Skip to content

Commit 1a8f9e2

Browse files
author
Kevin Paulisse
committed
Add some paths to integration reference check tests
1 parent 8a80966 commit 1a8f9e2

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

spec/octocatalog-diff/integration/reference_validation_spec.rb

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,15 @@ def self.catalog_contains_resource(result, type, title)
225225
expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::ReferenceValidationError)
226226
end
227227

228+
# rubocop:disable Metrics/LineLength
228229
it 'should have formatted error messages' do
229230
msg = @result.exception.message
230-
expect(msg).to match(/exec\[before alias caller\] -> before\[Exec\[before alias target\]\]/)
231-
expect(msg).to match(/exec\[notify alias caller\] -> before\[Exec\[notify alias target\]\]/)
232-
expect(msg).to match(/exec\[require alias caller\] -> before\[Exec\[require alias target\]\]/)
233-
expect(msg).to match(/exec\[subscribe alias caller\] -> before\[Exec\[subscribe alias target\]\]/)
231+
expect(msg).to match(%r{exec\[before alias caller\]\(/environments/production/modules/test/manifests/alias_callers.pp:2\) -> before\[Exec\[before alias target\]\]})
232+
expect(msg).to match(%r{exec\[notify alias caller\]\(/environments/production/modules/test/manifests/alias_callers.pp:7\) -> before\[Exec\[notify alias target\]\]})
233+
expect(msg).to match(%r{exec\[require alias caller\]\(/environments/production/modules/test/manifests/alias_callers.pp:12\) -> before\[Exec\[require alias target\]\]})
234+
expect(msg).to match(%r{exec\[subscribe alias caller\]\(/environments/production/modules/test/manifests/alias_callers.pp:17\) -> before\[Exec\[subscribe alias target\]\]})
234235
end
236+
# rubocop:enable Metrics/LineLength
235237
end
236238
end
237239

@@ -279,13 +281,15 @@ def self.catalog_contains_resource(result, type, title)
279281
expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::ReferenceValidationError)
280282
end
281283

284+
# rubocop:disable Metrics/LineLength
282285
it 'should have formatted error messages' do
283286
msg = @result.exception.message
284-
expect(msg).to match(/exec\[subscribe caller 1\] -> subscribe\[Exec\[subscribe target\]\]/)
285-
expect(msg).to match(/exec\[subscribe caller 2\] -> subscribe\[Exec\[subscribe target\]\]/)
286-
expect(msg).to match(/exec\[subscribe caller 2\] -> subscribe\[Exec\[subscribe target 2\]\]/)
287-
expect(msg).to match(/exec\[subscribe caller 3\] -> subscribe\[Exec\[subscribe target\]\]/)
287+
expect(msg).to match(%r{exec\[subscribe caller 1\]\(.+/modules/test/manifests/subscribe_callers.pp:2\) -> subscribe\[Exec\[subscribe target\]\]})
288+
expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:7\) -> subscribe\[Exec\[subscribe target\]\]})
289+
expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:7\) -> subscribe\[Exec\[subscribe target 2\]\]})
290+
expect(msg).to match(%r{exec\[subscribe caller 3\]\(.+/modules/test/manifests/subscribe_callers.pp:15\) -> subscribe\[Exec\[subscribe target\]\]})
288291
end
292+
# rubocop:enable Metrics/LineLength
289293
end
290294

291295
context 'with broken references in from-catalog' do
@@ -323,14 +327,16 @@ def self.catalog_contains_resource(result, type, title)
323327
expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::ReferenceValidationError)
324328
end
325329

330+
# rubocop:disable Metrics/LineLength
326331
it 'should have formatted error messages from to-catalog only' do
327332
msg = @result.exception.message
328-
expect(msg).to match(/exec\[subscribe caller 1\] -> subscribe\[Exec\[subscribe target\]\]/)
329-
expect(msg).to match(/exec\[subscribe caller 2\] -> subscribe\[Exec\[subscribe target\]\]/)
330-
expect(msg).to match(/exec\[subscribe caller 2\] -> subscribe\[Exec\[subscribe target 2\]\]/)
331-
expect(msg).to match(/exec\[subscribe caller 3\] -> subscribe\[Exec\[subscribe target\]\]/)
333+
expect(msg).to match(%r{exec\[subscribe caller 1\]\(.+/modules/test/manifests/subscribe_callers.pp:2\) -> subscribe\[Exec\[subscribe target\]\]})
334+
expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:7\) -> subscribe\[Exec\[subscribe target\]\]})
335+
expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:7\) -> subscribe\[Exec\[subscribe target 2\]\]})
336+
expect(msg).to match(%r{exec\[subscribe caller 3\]\(.+/modules/test/manifests/subscribe_callers.pp:15\) -> subscribe\[Exec\[subscribe target\]\]})
332337
expect(msg).not_to match(/require target/)
333338
end
339+
# rubocop:enable Metrics/LineLength
334340
end
335341

336342
context 'with broken references, but checking not enabled' do

0 commit comments

Comments
 (0)