summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-01-29 16:55:44 +0900
committerNobuyoshi Nakada <[email protected]>2025-03-18 23:47:20 +0900
commitf69ad0e810e1fdc18dc12f77bbecfa49999ef3bf (patch)
treec78a56901f15314471391d883685a64cda1af232 /spec
parent6670926a91734ddb92d01ce4578b1bb48d26b7de (diff)
[Bug #21094] Update nested module names when setting temporary name
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12947
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/module/set_temporary_name_spec.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/spec/ruby/core/module/set_temporary_name_spec.rb b/spec/ruby/core/module/set_temporary_name_spec.rb
index 12541374ae..12c1c214dd 100644
--- a/spec/ruby/core/module/set_temporary_name_spec.rb
+++ b/spec/ruby/core/module/set_temporary_name_spec.rb
@@ -108,13 +108,18 @@ ruby_version_is "3.3" do
m.name.should == "fake_name_2"
end
- it "does not affect a name of a module nested into an anonymous module with a temporary name" do
- m = Module.new
- m::N = Module.new
- m::N.name.should =~ /\A#<Module:0x\h+>::N\z/
-
- m.set_temporary_name("foo")
- m::N.name.should =~ /\A#<Module:0x\h+>::N\z/
+ ruby_bug "#21094", ""..."3.5" do
+ it "also updates a name of a nested module" do
+ m = Module.new
+ m::N = Module.new
+ m::N.name.should =~ /\A#<Module:0x\h+>::N\z/
+
+ m.set_temporary_name "m"
+ m::N.name.should == "m::N"
+
+ m.set_temporary_name nil
+ m::N.name.should == nil
+ end
end
it "keeps temporary name when assigned in an anonymous module" do