aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-16 00:53:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-16 00:53:18 +0000
commite0eb17f887c75abecdcceb2f1262646914708b29 (patch)
tree9f2d9df4410745814690689749cb948d8f43abab /test
parentbe8bebb151da30f83628bcf1f2a512d0d54ed3d0 (diff)
downloadruby-e0eb17f887c75abecdcceb2f1262646914708b29.tar.gz
* test/ruby/test_object.rb (test_remove_method): test for Bug#2202.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_object.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 8effe02310..75ec959ad5 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -265,6 +265,26 @@ class TestObject < Test::Unit::TestCase
c.instance_eval { remove_method(:foo) }
end
+ c = Class.new do
+ def meth1; "meth" end
+ end
+ d = Class.new(c) do
+ alias meth2 meth1
+ end
+ o1 = c.new
+ assert_respond_to(o1, :meth1)
+ assert_equal("meth", o1.meth1)
+ o2 = d.new
+ assert_respond_to(o2, :meth1)
+ assert_equal("meth", o2.meth1)
+ assert_respond_to(o2, :meth2)
+ assert_equal("meth", o2.meth2)
+ d.class_eval do
+ remove_method :meth2
+ end
+ bug2202 = '[ruby-core:26074]'
+ assert_raise(NoMethodError, bug2202) {o2.meth2}
+
%w(object_id __send__ initialize).each do |m|
assert_in_out_err([], <<-INPUT, %w(:ok), /warning: removing `#{m}' may cause serious problems$/)
$VERBOSE = false