summaryrefslogtreecommitdiff
path: root/test/ruby/test_class.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-18 22:54:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-18 22:54:25 +0000
commit125b62e76d97fd9483c9e15313f80c43a8c1a213 (patch)
tree83750302fec59fc52a83ab168178b04b5d2ed4e4 /test/ruby/test_class.rb
parentc4d77cb4adaae2bab9aa015c9a0528f0abf07bbd (diff)
* object.c (rb_obj_clone): singleton class should be attached
singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:44460]. [Bug #5274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r--test/ruby/test_class.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 55940a8891..12f78ddabc 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -258,4 +258,12 @@ class TestClass < Test::Unit::TestCase
END
assert_equal(42, PrivateClass.new.foo)
end
+
+ StrClone = String.clone
+ Class.new(StrClone)
+
+ def test_cloned_class
+ bug5274 = StrClone.new("[ruby-dev:44460]")
+ assert_equal(bug5274, Marshal.load(Marshal.dump(bug5274)))
+ end
end