From 624f44bc592a84c89a58bf29c85020c6ab3e2f56 Mon Sep 17 00:00:00 2001 From: kigland Date: Fri, 25 Sep 2026 09:57:37 +0800 Subject: [PATCH] test(ruby): pin factory ownership by node id --- .../ruby-factory-block-owner.test.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gitnexus/test/integration/ruby-factory-block-owner.test.ts b/gitnexus/test/integration/ruby-factory-block-owner.test.ts index 8668e4c0b..c897f0e14 100644 --- a/gitnexus/test/integration/ruby-factory-block-owner.test.ts +++ b/gitnexus/test/integration/ruby-factory-block-owner.test.ts @@ -69,23 +69,26 @@ end }); it.each([ - ['StructType', 'Struct', 'struct_method'], - ['DataType', 'Class', 'data_method'], - ['ClassType', 'Class', 'class_method'], - ['ModuleType', 'Trait', 'module_method'], - ['BraceType', 'Class', 'brace_method'], + ['StructType', 'Struct', 'struct_method', 'Outer.StructType'], + ['DataType', 'Class', 'data_method', 'Outer.DataType'], + ['ClassType', 'Class', 'class_method', 'Outer.ClassType'], + ['ModuleType', 'Trait', 'module_method', 'Outer.ModuleType'], + ['BraceType', 'Class', 'brace_method', 'Outer.BraceType'], ])( 'materializes %s as a %s and attributes its factory-block method', - (owner, ownerLabel, method) => { + (owner, ownerLabel, method, qualifiedOwner) => { const ownerNode = result.graph.nodes.find( - (node) => node.label === ownerLabel && node.properties.name === owner, + (node) => + node.label === ownerLabel && + node.properties.name === owner && + node.id.includes(qualifiedOwner), ); const ownership = getRelationships(result, 'HAS_METHOD').filter( (edge) => edge.target === method, ); expect(ownerNode).toBeDefined(); - expect(ownership.map((edge) => edge.source)).toEqual([owner]); + expect(ownership.map((edge) => edge.rel.sourceId)).toEqual([ownerNode?.id]); }, );