aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_objectspace.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_objectspace.rb')
-rw-r--r--test/ruby/test_objectspace.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb
index d519041f0b..a57c7ea1d1 100644
--- a/test/ruby/test_objectspace.rb
+++ b/test/ruby/test_objectspace.rb
@@ -109,4 +109,20 @@ End
p Thread.current[:__recursive_key__]
end;
end
+
+ def test_each_object_singleton_class
+ assert_separately([], <<-End)
+ class C
+ class << self
+ $c = self
+ end
+ end
+
+ exist = false
+ ObjectSpace.each_object(Class){|o|
+ exist = true if $c == o
+ }
+ assert(exist, 'Bug #11360')
+ End
+ end
end