@@ -17,7 +17,7 @@ def self.reference_validation_catalog(role, validations)
1717 end
1818
1919 def self . reference_validation_catalog_diff ( catalog1 , catalog2 , validations )
20- argv = [ '-n' , 'rspec-node.github.net' ]
20+ argv = [ '-n' , 'rspec-node.github.net' , '--no-parallel' ]
2121 validations . each { |v | argv . concat [ '--validate-references' , v ] }
2222 OctocatalogDiff ::Integration . integration (
2323 spec_catalog_old : "reference-validation-#{ catalog1 } .json" ,
@@ -255,10 +255,29 @@ def self.catalog_contains_resource(result, type, title)
255255 end
256256
257257 context 'with broken references in from- and to- catalogs' do
258+ before ( :all ) do
259+ @result = OctocatalogDiff ::Spec . reference_validation_catalog_diff (
260+ 'broken-2' ,
261+ 'broken' ,
262+ %w( before notify require subscribe )
263+ )
264+ end
265+
258266 it 'should not succeed' do
267+ expect ( @result . exitcode ) . to eq ( -1 ) , OctocatalogDiff ::Integration . format_exception ( @result )
259268 end
260269
261- it 'should raise error' do
270+ it 'should raise ReferenceValidationError' do
271+ expect ( @result . exception ) . to be_a_kind_of ( OctocatalogDiff ::Catalog ::ReferenceValidationError )
272+ end
273+
274+ it 'should have formatted error messages from to-catalog only' do
275+ msg = @result . exception . message
276+ expect ( msg ) . to match ( /exec\[ subscribe caller 1\] -> subscribe\[ Exec\[ subscribe target\] \] / )
277+ expect ( msg ) . to match ( /exec\[ subscribe caller 2\] -> subscribe\[ Exec\[ subscribe target\] \] / )
278+ expect ( msg ) . to match ( /exec\[ subscribe caller 2\] -> subscribe\[ Exec\[ subscribe target 2\] \] / )
279+ expect ( msg ) . to match ( /exec\[ subscribe caller 3\] -> subscribe\[ Exec\[ subscribe target\] \] / )
280+ expect ( msg ) . not_to match ( /require target/ )
262281 end
263282 end
264283
0 commit comments