Skip to content

Commit 5d316e7

Browse files
committed
Adding a test for initialize_clone and initialize_dup. From Github:
ruby#190 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent f6848bf commit 5d316e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/ruby/test_object.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ def test_dup
2121
end
2222
end
2323

24+
def test_init_dupclone
25+
cls = Class.new do
26+
def initialize_clone(orig); throw :initialize_clone; end
27+
def initialize_dup(orig); throw :initialize_dup; end
28+
end
29+
30+
obj = cls.new
31+
assert_throws(:initialize_clone) {obj.clone}
32+
assert_throws(:initialize_dup) {obj.dup}
33+
end
34+
2435
def test_instance_of
2536
assert_raise(TypeError) { 1.instance_of?(1) }
2637
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy