1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Adding a test for initialize_clone and initialize_dup. From Github:

https://github.com/ruby/ruby/pull/190

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2012-10-05 16:22:03 +00:00
parent f6848bf1c6
commit 5d316e7786

View file

@ -21,6 +21,17 @@ class TestObject < Test::Unit::TestCase
end
end
def test_init_dupclone
cls = Class.new do
def initialize_clone(orig); throw :initialize_clone; end
def initialize_dup(orig); throw :initialize_dup; end
end
obj = cls.new
assert_throws(:initialize_clone) {obj.clone}
assert_throws(:initialize_dup) {obj.dup}
end
def test_instance_of
assert_raise(TypeError) { 1.instance_of?(1) }
end