summaryrefslogtreecommitdiff
path: root/spec/ruby/core/data/shared
diff options
context:
space:
mode:
authorAndrew Konchin <andry.konchin@gmail.com>2025-06-02 19:34:54 +0300
committerBenoit Daloze <eregontp@gmail.com>2025-06-02 21:54:48 +0200
commitd6aa1714fed3e8b5ee8bede00a8853c338ff6092 (patch)
treeea863a44d9026f74b9a07375f401c3e5d8cb4bf5 /spec/ruby/core/data/shared
parent685c8ca9af892f562f64b54dbee73bb9a1999b90 (diff)
Update to ruby/spec@4d2fc4d
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13495
Diffstat (limited to 'spec/ruby/core/data/shared')
-rw-r--r--spec/ruby/core/data/shared/inspect.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/data/shared/inspect.rb b/spec/ruby/core/data/shared/inspect.rb
index 7f54a46de3..6cd5664da7 100644
--- a/spec/ruby/core/data/shared/inspect.rb
+++ b/spec/ruby/core/data/shared/inspect.rb
@@ -50,5 +50,13 @@ describe :data_inspect, shared: true do
a.send(@method).should == "#<data DataSpecs::Measure amount=42, unit=#<data DataSpecs::Measure:...>>"
end
+
+ it "returns string representation with recursive attribute replaced with ... when an anonymous class" do
+ klass = Class.new(DataSpecs::Measure)
+ a = klass.allocate
+ a.send(:initialize, amount: 42, unit: a)
+
+ a.send(@method).should =~ /#<data amount=42, unit=#<data #<Class:0x.+?>:\.\.\.>>/
+ end
end
end