From 28097236185a298b3a62c72b66b0aacb5bcac0c6 Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Wed, 8 Jul 2026 13:40:54 +0500 Subject: [PATCH 1/2] add collection: true to collection and fix specs --- lib/xmi/uml/owned_comment.rb | 5 +++-- lib/xmi/uml/owned_element.rb | 4 ++-- spec/xmi/sparx/sparx_root_xmi2013_uml2013_spec.rb | 2 +- spec/xmi/sparx/sparx_root_xmi_parsing_spec.rb | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/xmi/uml/owned_comment.rb b/lib/xmi/uml/owned_comment.rb index 540dd3b..75f633c 100644 --- a/lib/xmi/uml/owned_comment.rb +++ b/lib/xmi/uml/owned_comment.rb @@ -7,7 +7,7 @@ class OwnedComment < Base attribute :body_element, :string attribute :body_attribute, :string attribute :annotated_attribute, :string - attribute :annotated_element, AnnotatedElement + attribute :annotated_element, AnnotatedElement, collection: true xml do root "ownedComment" @@ -15,7 +15,8 @@ class OwnedComment < Base map_attribute "body", to: :body_attribute map_attribute "annotatedElement", to: :annotated_attribute - map_element "annotatedElement", to: :annotated_element + map_element "annotatedElement", to: :annotated_element, + value_map: VALUE_MAP map_element "body", to: :body_element end end diff --git a/lib/xmi/uml/owned_element.rb b/lib/xmi/uml/owned_element.rb index 9ad5752..3c739b9 100644 --- a/lib/xmi/uml/owned_element.rb +++ b/lib/xmi/uml/owned_element.rb @@ -12,7 +12,7 @@ class OwnedElement < ::Xmi::UmlDi::Base attribute :bounds, Bounds, collection: true attribute :source, :string attribute :target, :string - attribute :waypoint, Waypoint + attribute :waypoint, Waypoint, collection: true xml do root "ownedElement" @@ -23,7 +23,7 @@ class OwnedElement < ::Xmi::UmlDi::Base map_element "bounds", to: :bounds, value_map: VALUE_MAP map_element "source", to: :source map_element "target", to: :target - map_element "waypoint", to: :waypoint + map_element "waypoint", to: :waypoint, value_map: VALUE_MAP end end end diff --git a/spec/xmi/sparx/sparx_root_xmi2013_uml2013_spec.rb b/spec/xmi/sparx/sparx_root_xmi2013_uml2013_spec.rb index 5012c99..6d2c5bb 100644 --- a/spec/xmi/sparx/sparx_root_xmi2013_uml2013_spec.rb +++ b/spec/xmi/sparx/sparx_root_xmi2013_uml2013_spec.rb @@ -20,7 +20,7 @@ expect(xmi_root_model.model).to be_instance_of(Xmi::Uml::UmlModel) expect(xmi_root_model.model.name).to eq("EA_Model") expect(xmi_root_model.model.packaged_element).to be_instance_of(Array) - expect(xmi_root_model.model.packaged_element.first).to be_instance_of(Xmi::Uml::PackagedElement) + expect(xmi_root_model.model.packaged_element.first).to be_instance_of(Xmi::Uml::Package) expect(xmi_root_model.model.packaged_element.first.name).to eq("requirement type class diagram") end diff --git a/spec/xmi/sparx/sparx_root_xmi_parsing_spec.rb b/spec/xmi/sparx/sparx_root_xmi_parsing_spec.rb index 695d2bc..9de635c 100644 --- a/spec/xmi/sparx/sparx_root_xmi_parsing_spec.rb +++ b/spec/xmi/sparx/sparx_root_xmi_parsing_spec.rb @@ -20,7 +20,7 @@ expect(xmi_root_model.model).to be_instance_of(Xmi::Uml::UmlModel) expect(xmi_root_model.model.name).to eq("EA_Model") expect(xmi_root_model.model.packaged_element).to be_instance_of(Array) - expect(xmi_root_model.model.packaged_element.first).to be_instance_of(Xmi::Uml::PackagedElement) + expect(xmi_root_model.model.packaged_element.first).to be_instance_of(Xmi::Uml::Package) expect(xmi_root_model.model.packaged_element.first.name).to eq("requirement type class diagram") end @@ -76,7 +76,7 @@ expect(xmi_root_model.model).to be_instance_of(Xmi::Uml::UmlModel) expect(xmi_root_model.model.name).to eq("EA_Model") expect(xmi_root_model.model.packaged_element).to be_instance_of(Array) - expect(xmi_root_model.model.packaged_element.first).to be_instance_of(Xmi::Uml::PackagedElement) + expect(xmi_root_model.model.packaged_element.first).to be_instance_of(Xmi::Uml::Package) expect(xmi_root_model.model.packaged_element.first.name).to eq("ISO 6709 Edition 2") end From 890b8fee31c2283ee69d158b966a89527a0fd77a Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Wed, 8 Jul 2026 14:46:10 +0500 Subject: [PATCH 2/2] fix linter issues --- spec/xmi/uml/interface_realization_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/xmi/uml/interface_realization_spec.rb b/spec/xmi/uml/interface_realization_spec.rb index 4274c83..8327db5 100644 --- a/spec/xmi/uml/interface_realization_spec.rb +++ b/spec/xmi/uml/interface_realization_spec.rb @@ -87,7 +87,7 @@ it "is not present in current Sparx EA fixture output" do ea_fixture = cached_fixture("ea-xmi-2.5.1.xmi") - expect(ea_fixture).not_to match(/