From d464adabbd6dacc3ba428e7ff07add180edce839 Mon Sep 17 00:00:00 2001 From: Sylvain Joyeux Date: Thu, 17 Sep 2026 11:44:59 -0300 Subject: [PATCH] fix: replace facet's constant by const_get --- lib/syskit/actions/profile.rb | 2 +- lib/syskit/droby/v5/droby_dump.rb | 2 +- test/droby/test_droby_dump.rb | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/syskit/actions/profile.rb b/lib/syskit/actions/profile.rb index 48a51bf7d..d8b457cb9 100644 --- a/lib/syskit/actions/profile.rb +++ b/lib/syskit/actions/profile.rb @@ -270,7 +270,7 @@ def resolved_dependency_injection end def to_s - name + name || "" end # Promote requirements taken from another profile to this profile diff --git a/lib/syskit/droby/v5/droby_dump.rb b/lib/syskit/droby/v5/droby_dump.rb index 6e5a75f8d..e33833fa6 100644 --- a/lib/syskit/droby/v5/droby_dump.rb +++ b/lib/syskit/droby/v5/droby_dump.rb @@ -308,7 +308,7 @@ def proxy(peer) profile = begin - constant(@name) + Object.const_get(@name) rescue Exception Actions::Profile.new(@name) end diff --git a/test/droby/test_droby_dump.rb b/test/droby/test_droby_dump.rb index ff042cfec..5a37f9447 100644 --- a/test/droby/test_droby_dump.rb +++ b/test/droby/test_droby_dump.rb @@ -187,8 +187,10 @@ def proxy(_peer) it "returns the constant" do droby = droby_local_marshaller.dump(Actions::Profile.new("AProfile")) droby = Marshal.load(Marshal.dump(droby)) - flexmock(droby).should_receive(:constant).with("AProfile") - .and_return(profile = Actions::Profile.new) + profile = Syskit::Actions::Profile.new + flexmock(Object) + .should_receive(:const_get).with("AProfile") + .and_return(profile) unmarshalled = droby_remote_marshaller.local_object(droby) assert_same profile, unmarshalled end